Added supporter model and send email with the password

This commit is contained in:
2017-03-30 21:03:59 +02:00
parent 175c9bea4f
commit cfc1fbfd9f
12 changed files with 38 additions and 10 deletions
+2 -1
View File
@@ -7,8 +7,9 @@ class SupportersController < ApplicationController
def create
@supporter = Supporter.new supporter_form_params.merge(language: I18n.locale)
@supporter.password = random_password = SecureRandom.hex(5)
if !input_to_fast? && @supporter.save
# SupporterMailer.welcome_email(@supporter).deliver_now
SupporterMailer.welcome_email(@supporter, random_password).deliver_now
mailchimp_registration
redirect_to thanks_path
else