Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export SENDGRID_USERNAME=<my SendGrid account's user name>
- export SENDGRID_PASSWORD=<my SendGrid account's password>
- development:
- email_provider_username: <%= ENV["SENDGRID_USERNAME"] %>
- email_provider_password: <%= ENV["SENDGRID_PASSWORD"] %>
- ...
- # Configure ActionMailer SMTP settings for SendGrid
- config.action_mailer.smtp_settings = {
- ...
- user_name: Rails.application.secrets.email_provider_username,
- password: Rails.application.secrets.email_provider_password
- }
- def create
- @contact = Contact.new(secure_params)
- if @contact.valid?
- UserMailer.contact_email(@contact).deliver_now
- flash[:notice] = "Message sent from #{@contact.name}."
- redirect_to root_path
- else
- render :new
- end
- end
- echo $SENDGRID_USERNAME
- echo $SENDGRID_PASSWORD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement