Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Share < ActionMailer::Base
- def share_with_one(recipient, from_user, photo)
- recipients recipient.to_s
- from from_user.email
- subject from_user.full_name+" Wants to Share a Photo With You."
- body :user => from_user,
- :photo => photo,
- :photo_url => url_for(:host => photo.project.domain, :action=>'view', :controller=>'photo', :id=>photo.id)
- #content_type "text/html"
- end
- def share_with_many(recipient, from_user, photo)
- recipients recipient.to_s
- from from_user.email
- subject from_user.full_name_plural+" photo needs your support!"
- body :user => from_user,
- :photo => photo,
- :photo_url => url_for(:host => photo.project.domain, :action=>'view', :controller=>'photo', :id=>photo.id)
- #content_type "text/html"
- end
- def promote(recipient, from_user)
- recipients recipient.to_s
- from from_user.email
- subject from_user.full_name+" wants you to join in the best of "+from_user.project.book_scope+"!"
- body :user => from_user,
- :photo => from_user.best_photo
- #content_type "text/html"
- end
- def signup_thanks( user, password )
- # Email header info MUST be added here
- recipients user.email
- from "yourfriends@capturebook.com"
- subject "Thanks for signing up!"
- #content_type "text/html"
- # Email body substitutions go here
- body :first_name => user.first_name, :last_name => user.last_name, :project => user.project, :username => user.login, :password => password
- end
- def reset_password(user, password )
- # Email header info MUST be added here
- recipients user.email
- from "yourfriends@capturebook.com"
- subject "Your password has been reset! Here's a temporary one."
- #content_type "text/html"
- # Email body substitutions go here
- body :user => user, :tmppass => password
- end
- def report_offensive(photo, user=nil, ip=nil)
- recipients "admin@capturebook.com"
- from "yourfriends@capturebook.com"
- subject "**Possibly Offensive Photo**"
- #content_type "text/html"
- body :photo => photo, :user => user, :ip => ip
- end
- def report_offensive_comment(comment, user=nil, ip=nil)
- recipients "admin@capturebook.com"
- from "yourfriends@capturebook.com"
- subject "**Possibly Offensive Comment**"
- #content_type "text/html"
- body :comment => comment, :user => user, :ip => ip, :comment_link => url_for(:host=>comment.photo.project.domain, :action=>"view", :controller=>"photo", :id=>comment.photo.id).to_s+"#comment_"+comment.id.to_s
- end
- def contact_form(sender, body_text, project)
- if sender.nil? or sender.empty?
- sender = "yourfriends@capturebook.com"
- end
- recipients "admin@capturebook.com"
- from sender
- subject "Contact Form Submission -- #{project.title}"
- body :text => body_text, :project => project, :sender => sender
- end
- def bests_notice(user, chapter_photos)
- recipients user.email
- from "yourfriends@capturebook.com"
- subject "Congratulations "+user.first_name.titlecase+"! You have a great photo!"
- body :user => user,
- :chapter_photos => chapter_photos,
- :share_url => url_for(:host => user.project.domain, :action=>'promote', :controller=>'user')
- end
- end
Add Comment
Please, Sign In to add comment