Sending a responsive email template and
Need to watch
https://www.driftingruby.com/episodes/mail-previews-and-templates
Get some template here http://foundation.zurb.com/emails/email-templates.html
add this in your gem file
gem 'premailer-rails'
gem 'postmark-rails', '~> 0.15.0'
To make the postmark use environment variables please follow this steps
Comment out the default "from:" in ApplicationMailer
To create an environment variable
nano ~/.bashrc
and add this line
export POSTMARK_API_TOKEN=b998c489-82e9-46a6-bc43-eb6c8fcc31c4
export POSTMARK_DEFAULT_FROM='postmark_registered_email'
in your secrets.yml
production:
admin_name: <%= ENV["ADMIN_NAME"] %>
admin_email: <%= ENV["ADMIN_EMAIL"] %>
admin_password: <%= ENV["ADMIN_PASSWORD"] %>
email_provider_username: <%= ENV["SENDGRID_USERNAME"] %>
email_provider_password: <%= ENV["SENDGRID_PASSWORD"] %>
domain_name: <%= ENV["DOMAIN_NAME"] %>
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
site_title: <%= ENV["SITE_TITLE"] %>
site_description: <%= ENV["SITE_DESCRIPTION"] %>
postmark_api_token: <%= ENV["POSTMARK_API_TOKEN"] %>
default_from_email: <%= ENV["POSTMARK_DEFAULT_FROM"] %>
in your application.rb add this lines
config.action_mailer.delivery_method = :postmark
config.action_mailer.postmark_settings = { :api_token => Rails.application.secrets.postmark_api_token }
config.action_mailer.default_options = { from: Rails.application.secrets.default_from_email }
0 comments:
Post a Comment