Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- subject = 'MedX. Registration request'
- if Rails.env.development?
- mail(to: email, subject: subject)
- else
- template = Slim::Template.new(
- Rails.root.join('app', 'views', 'user_mailer', 'send_registration_request.html.slim')
- ).render
- mg_client = ::Mailgun::Client.new(ENV['MAILGUN_API_KEY'])
- message_params = {
- from: 'admin@medx.com',
- to: email,
- subject: 'The Ruby SDK is awesome!',
- text: template
- }
- mg_client.send_message(ENV['MAILGUN_DOMAIN'], message_params)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement