Anu
Joined: 01 Jan 2010 Posts: 82
|
Posted: Wed Jun 09, 2010 9:44 am Post subject: Sanitizeemail plugin |
|
|
Hi,
This SanitizeEmail allows you to know if the email sent to actual live addresses.
To download this plugin:
./script/plugin install git://github.com/pboling/sanitize_email.git
Configuration:
Add this lines of code in your environment.rb
ActionMailer::Base.sanitized_recipients = "developer@example.com"
ActionMailer::Base.sanitized_bcc = nil
ActionMailer::Base.sanitized_cc = nil
And a method in model that you can call to test the signup email.
class User < ActiveRecord::Base
def test_signup_email_me_only
UserMailer.force_sanitize = true
UserMailer.deliver_signup_notification(self)
UserMailer.force_sanitize = nil
end
def test_signup_email_user_only
UserMailer.force_sanitize = false
UserMailer.deliver_signup_notification(self)
UserMailer.force_sanitize = nil
end
def test_signup_email_environment
OicuMailer.deliver_signup_notification(self)
end
end
Load ruby script/server,
*User.find(4).test_signup_email_me_only
and the email will have it's own recipients, bcc, and cc overridden to be, then sanitized values(what you set before in the environment.rb).
if you want to send it to the actual user, instead of declaredbcc and cc
then,,
*User.find(4).test_signup_email_user_only
Thank you,
Anu.  |
|