SUSE / Portus

Authorization service and frontend for Docker registry (v2)
http://port.us.org/
Apache License 2.0
3k stars 473 forks source link

Email Templates #1141

Open Vad1mo opened 7 years ago

Vad1mo commented 7 years ago

I would like to change the email templates that are send to support also HTML.

how would I do that? I am a bit confused where and how emails are send.

mssola commented 7 years ago

If I recall correctly, we only use emails for stuff like recovering passwords and such, users really don't write emails inside of the app. Could you provide an use case for this ?

Vad1mo commented 7 years ago

I would like to change those transactional recovery email and add HTML layout. Also I would like to add an "new user" email, if the admin creates a new user.

Vad1mo commented 7 years ago

So how am I able to change the text of the mail so I can extend it to also support html.I didn't find any code related to emails except a few text snippets

mssola commented 7 years ago

I didn't find any code related to emails except a few text snippets

That's because we don't 😄 We rely completely on Devise for this. If you want to customize this, a first step would be to manage those mailer views from the portus source code. You can find information on how to do this here: https://github.com/plataformatec/devise#configuring-views

After you have something working with your own views, you will need to add some way so people could customize their mailer views. I'm honestly not sure on the best way of accomplishing this, and I'm a bit worried that it might be a can of worms, but I'm open for idea 😉