Rails 3.1 - Devise inserting address into subject line of confirmation email - ruby-on-rails-3.1

I'm using rails 3.1 with Devise. When an account confirmation email goes out, it is received with the following subject line:
Subject: [["test13#test.com"]]MySite Account Confirmation Instructions
I've modified the corresponding entry in config/locals/devise.en.yml like this:
mailer:
confirmation_instructions:
subject: 'MySite Account Confirmation Instructions'
I don't want the '[["test13#test.com"]] in the email subject line. How can I get Devise to not put it there? BTW I really don't want to have to create some custom mailer that overrides Devises' stock mailer... Big extra bonus points for an answer that avoids anything to do with custom mailers. But if that is the only way, I need to know that too...

My guess is that the [["test13#test.com"]] should actually only show up in development mode, since that's the format of ActionMailer's DevelopmentMailInterceptor (see the notes in RailsCast 206)
The email address between brackets indicates the address to which the email would have been sent on production. It instead sends it to you at an email specified in your DevelopmentMailInterceptor.

The mail subject is generated in Devise::Mailers::Helpers.headers_for (source code here), so the most straightforward way would be monkey-patching this method.

This was a strange one... Had to reboot my Mac, after which the problem was gone.

Related

Is simple email address validation good enough by just checking for #

My company has an app that currently only validates by looking for the '#' in the email address. The app is being upgraded to support other cultures and written language use-cases. I suggested using regex code from Microsoft that validates the addresses using regex. They don't see the need to use the regex version if checking for '#' works. My question here is... What pitfalls exist if the validation isn't good enough. Meaning the email server will not be able to send the emails if they have the '#' but fail other checks. What can go wrong?
The list can be quite long:
1#2
do#home
why#home&not#boooom
iAm#...
#where
#homeIsaid
NoYouAreNot#home
....#......
and so on.
All of these are mistakenly valid email addresses if you only check for #
That said, it's worth mentioning coming up with an email address regex that works can be quite difficult. See this

Creating a view-field with the sender's domain

It's cleanup time.
I'd like to cleanaup my mails. Therefore it would be nice to have all emails sorted/grouped by domains (optionally by TLD's as well).
I'm already using something similar - the field for the sender's email adress, which was described at https://www.howto-outlook.com/howto/viewsenderaddress.htm, which works perfectly. So I think something similar can be done for the domain (and TLD) as well.
Has someone here either a working solution ans share it or guide me how to achieve this.
Thx.
Remarks:
It's Outlook 2007 without Exchange
Thanks to a big search engine when using the proper words solution can be found. :-)
I have found a solution which displays the Senders Domain: https://www.extendoffice.com/documents/outlook/2190-outlook-view-sender-domain.html
and to Sort and Group on the Domain use
https://www.extendoffice.com/documents/outlook/2187-outlook-sort-group-by-sender-domain.html

Customer email using .online tld is being rejected

I'm using DotNetKit 1.2.6.5 and SagePayIntegration.Validation() is rejecting a customer email that uses the new .online domain (eg: foo#bar.online) with
CustomerEMail is invalid.
Is this fixed in 1.2.6.7 or is the source code for SagePay.IntegrationKit.DotNet.dll available somewhere so I can fix it?
Despite access to the source code (many thanks to #DavidG) SagePay Support have confirmed that the actual Gateway does not support all these new domains - so even if I modified the DotNetKit it would still be rejected by the Gateway.
SagePay support were very helpful but ultimately the
"... email domain foo#bar.online is not yet supported on our gateway.
We run development sprints continuously and although there are some
domains we may not yet support, we look to in future, dependent on
impact and demand..."
The SagePay Integration Kit uses this regex to validate email addresses:
[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*#(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+(?:[a-zA-Z]{2,4})\b
Which does unfortunately not allow extra long TLDs. Fortunately I have the source code for the kit and I've added it to my GitHub account (along with a bug fix which is why I had to get it in the first place as SagePay are not updating it). You can find it here:
https://github.com/WiredUK/SagePay.IntegrationKit
And the Regex you need to edit is this file:
https://github.com/WiredUK/SagePay.IntegrationKit/blob/801f61cf965c391a98a025aa632949719084cef0/ApiRegex.cs
For info, you need to edit the very last part of the expression from 2,4 (which matches 2 to 4 characters in the TLD) to allow more, for example 2,30.
Edit: And just because I can, I opened an issue and fixed it.

How to automatically add email comments to existing JIRA issue

I've done this before but can't remember how to do this anymore.
Let's say I have a JIRA issue# 967 open.
I'm emailing a couple of people with comments on this issue using my Outlook email.
What do I need to do so that this comment automatically gets added as part of the JIRA issue?
See the Atlassian documentation here. Replace JIRA in the URL with the version number you're on if you are using an older version, e.g. JIRA044
Please make sure you're following the guides that fits your Jira version, there is a page for each version. Follow this guide to set up issue and comments creation via email.
Basically you need to :
Configure mail server - use your exchange server or external service as Google.
Configure a mail handler - probably you will want to use one of Jira's built-in mail handlers.
Important notes-
To create a comment for isser key TEST-123 the email's subject has to contain the issue key, e.g. Subject: Re: TEST-123 updates.
Emails without subject line won't be processed.
read this for more tips.

Using selenium in order to read emails on gmail

I'm using selenium-rc and I'm trying to click on a specific email on gmail in order to get into the email page. More specifically: on the gmail inbox, click on a email with a specific subject.
I can't find the correct xpath (none of the tags in the email part are links). Ideas?
This XPath should do the trick:
//div[#class = 'y6']/span[contains(., 'subject_here')]
... provided that you've first changed to the canvas_frame frame. Otherwise, it's unlikely it'll work at all. If you're not using Firebug to inspect the HTML, you really should as that's how I found out these values. Also, the Gmail structure changes fairly regularly, so that y6 class could change any day.
I haven't tested this, but this might work for you:
open http://gmail.com
// do the login stuff, click on login
waitForElementPresent canvas_frame
selectFrame canvas_frame
waitForElementPresent //div[#class = 'y6']/span[contains(., 'subject_here')]
clickAt //div[#class = 'y6']/span[contains(., 'subject_here')] 0,0
// do stuff you care about
Important: you have to use clickAt to cause Gmail to realize you're clicking. It doesn't work with just the simple "click" command.
By the way, we do this for our own internal monitoring of Gmail because it's been so unstable over the last few months. We're using my companies Selenium-based free monitoring service, which lets you run Selenium scripts to check performance and functionality of your site.
change gmail to basic html mode.
Is your app a Ruby on Rails one by chance? If so, email spec is a great way to test emails without haveing to mess around with Gmail: http://github.com/bmabey/email-spec
I used this command
clickAt | //table/tbody/tr/td[5]/div[#class='yW'] |
Click at the FROM field of first/recent/top most mail to go to mail detail page. // note: tr for first mail, tr[2] for second and so on.

Resources