Sending transactional emails
When you followed the quickstart, you configured your Amazon SES credentials to send transactional emails.
On top of that, your RailsFast app is configured to send beautiful transactional emails using the goodmail gem by default. So instead of sending boring, ugly, plaintext emails -- you send well-designed emails that look good on all email clients:
All your user auth emails and your payment-related emails come already configured and working out of the box.
You can view and edit all those emails:
app/mailers/devise_goodmailer.rbfordevise-related emails (user authentication)app/mailers/pay_goodmailer.rbforpay-related emails (payments & subscriptions)
Other than the pre-configured emails, you can also send a transactional email at any point in your app like this:
mail = Goodmail.compose(
to: recipient.email,
from: "'#{Goodmail.config.company_name} Support' <[email protected]>",
subject: "Welcome!",
) do
h1 "Welcome aboard, #{recipient.name}!"
text "We're thrilled to have you join the community."
button "Go to Dashboard", user_dashboard_url(recipient)
sign
end
mail.deliver_now
You can customize all transactional emails however you want! Add animated GIFs, change the text, make new emails... make sure to read the goodmail gem docs to know everything that's possible.
If you don't like goodmail, or if you'd like to use your own email templates, you can still use Rails' ActionMailer -- goodmail is just an add-on, doesn't replace Action Mailer, you can keep writing emails with Action Mailer if that's what you like!