Created
April 28, 2010 16:40
-
-
Save DAddYE/382354 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp.mailer :notifier do | |
deafult :from => "[email protected]" | |
email :registration do |name, surname, email| | |
to email | |
subject "Registration" | |
content_type "text/plain" | |
body render('notifier/registration') | |
end | |
email :comment do |account, post| | |
to Account.administrators_emails | |
subject "New comment on #{post.title}" | |
body render('comments/preview', :layout => false) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyApp < Padrino::Application | |
mailer :accounts do | |
deafult :from => "[email protected]" | |
email :signup do |name, surname, email| | |
to email | |
subject "Registration" | |
content_type "text/plain" | |
body render('notifier/registration') | |
end | |
end | |
contoller :accounts do | |
post :signup do | |
@account = Account.create(params[:account]) | |
... | |
Mailer.deliver(:accounts, :signup, :name => account.name, :surname => account.surname, :email => account.email) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check out the issue for the work I have done to support this syntax with a nice dsl layer over the existing system: http://github.com/padrino/padrino-framework/issues/#issue/127