-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text-only email templates #5034
Comments
Hi @Medvezo, thanks for bringing this up. I agree with you that is important to include text versions of the emails, but do you think we need to send only them, without the HTML versions? By reading the references you pointed out, all of them say that it is safe to send both, as long as the text and links are similar to HTML version. I've also worked on applications that did something similiar in the past and it worked well. Thoughts? |
I was also going to bring this up, I solved this by overwriting the default devise templates. Sending both works well and only sending html email might be linked to being sent to gmails notorious promotion tab :) I could start work on this, drawing on what we have done so far and open a PR if you think this is interesting to the broader user base. |
@JanBussieck That would be great! |
If we supplied the text formats alongside the html (in app/views/devise/mailer) wouldn't this automagically send multi-part via ActionMailer? ref: https://guides.rubyonrails.org/action_mailer_basics.html#sending-multipart-emails You could then essentially configure which format (or both by default) get sent via action mailer's config options. It wouldn't be specific to devise, but I would expect the domain requirement would be consistent anyways, right? default Edit: ref: https://github.com/plataformatec/devise/blob/master/lib/devise/mailers/helpers.rb#L31 |
I think so 👍 |
I've put a bit of time into this and wanted to report back a bit on my findings so far. If the goal is just to send multipart emails, it is a small code change (just adding the templates). Where things get messy is dealing with backwards compatibility and not wanting to release a change that essentially locks people into a multipart-emails as a requirement. I think this needs to be an opt-in/explicit configuration feature. There are way too many deployments of devise with very customized emails to just rollout this change otherwise, imho. Due to the way that rails (actionmailer specifically) handles formats (similar to other types of views) if the formats exist, they will be used. This means that if we add them to the gem-based views ( So, what is the only 'safe' way of rolling this out? Other than that, I think we have painted ourselves into a box a bit as far as a graceful upgrade path here. More technically, we loose a lot of control in preventing formats from going out since I want to chew on this a bit more with some concrete tests to see what happens in the various scenarios, but overall – I don't think we are ready to implement this 'as a small change' and as such, I want to see if there is a better approach, maybe even shipping a |
I circled back a bit, it seems that even if you override the I know this is a bit to get through, but before moving forward, I'd want a bit more buy-in from the group and team as to the direction they'd like to see this move. In the meantime (time permitting) I was going to dig more into the |
Hopefully this addresses the problem in #1245 - we'll need to test deliverability in production to know if it fixes it or not. See heartcombo/devise#5034 for some good background on this approach.
# What it does Hopefully this addresses the problem in #1245 - we'll need to test deliverability in production to know if it fixes it or not. # Why it is important We don't want any emails to be marked as spam - especially password reset emails! # Implementation notes * See heartcombo/devise#5034 for some good background on this approach.
Problem
By default Devise comes with html templates. The problem with that is that some spam catching systems may consider that as a negative signal and route email to spam folder. That is worrisome because we are talking about transactional email. Think of all extra customer support emails that will generate in the long run.
Solution
Ship with text-only templates for the next major release (5.0.0).
References
The text was updated successfully, but these errors were encountered: