Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. export SENDGRID_USERNAME=<my SendGrid account's user name>
  2. export SENDGRID_PASSWORD=<my SendGrid account's password>
  3.  
  4. development:
  5. email_provider_username: <%= ENV["SENDGRID_USERNAME"] %>
  6. email_provider_password: <%= ENV["SENDGRID_PASSWORD"] %>
  7. ...
  8.  
  9. # Configure ActionMailer SMTP settings for SendGrid
  10. config.action_mailer.smtp_settings = {
  11. ...
  12. user_name: Rails.application.secrets.email_provider_username,
  13. password: Rails.application.secrets.email_provider_password
  14. }
  15.  
  16. def create
  17. @contact = Contact.new(secure_params)
  18. if @contact.valid?
  19. UserMailer.contact_email(@contact).deliver_now
  20. flash[:notice] = "Message sent from #{@contact.name}."
  21. redirect_to root_path
  22. else
  23. render :new
  24. end
  25. end
  26.  
  27. echo $SENDGRID_USERNAME
  28. echo $SENDGRID_PASSWORD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement