This is my first Rails project, and I may be missing something
obvious, but… I need to send emails to a group of people, but the
content is individualised, so I cannot bcc them, so I put it into a
loop. It sends the first email OK then fails with an “uninitialized
constant Admin::PrivateNewslettersController::NewsletterMailer” error.
Fore testing I have reduced it to 3 addresses in test_arry, and taken
out the encryption processing.
In the controller I have:
test_arry = [‘[email protected]’, ‘[email protected]’, ‘[email protected]’]
test_arry.each do |an_email|
email = an_email
name = ‘john’
encrypted = [‘abc’]
NewsletterMailer.newsletter_email(email, name, encrypted)
end
In the Mailer I have:
class Admin::NewsletterMailer < ActionMailer::Base
default :from => “administrator@xxxxxxxx”
def newsletter_email(email, name, encrypted)
@name = name
@url = “http://www.xxxxxxx/nl/download/”+encrypted.to_s
mail(:to => email, :subject => “Dark Peak Newsletter”)
end
end