mailjet-gem icon indicating copy to clipboard operation
mailjet-gem copied to clipboard

add instructions to override settings using ActionMailer callbacks

Open jgigault opened this issue 5 years ago • 3 comments

Note: This commit also includes an update of .gitignore file for IntelliJ IDEs users

I was looking for a solution to temporary override Mailjet credentials without having to specify api_key and secret_key params within delivery_method_options of all my mailers. The idea of using callbacks is to keep the mailers very clean, but it requires to manually map Mailjet settings with raw user_name and password SMTP settings.

I am wondering if this tip should be part of the README, but I wanted to share it to you.
Please give me feedbacks if you think about a better integrated solution.

jgigault avatar May 26 '19 22:05 jgigault

I was faced with the exact same problem, and since the Rails documentation is misleading on this matter, it took me a while to realize I could use an after_action callback.

In my opinion, this PR should be merged. :+1:

Note : @jgigault perhaps you could rebase and push --force so it would trigger the CI again and probably pass! :wink:

francois-ferrandis avatar Nov 30 '20 06:11 francois-ferrandis

Nice to see you there @francois-ferrandis :-) Now I am feeling not alone with my proposal!

jgigault avatar Jan 06 '21 23:01 jgigault

I experienced #219 while trying to implement something along these lines.

boardfish avatar Aug 18 '21 10:08 boardfish