Guest User

Untitled

a guest
Apr 12th, 2018
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. class Share < ActionMailer::Base
  2. def share_with_one(recipient, from_user, photo)
  3.  
  4. recipients recipient.to_s
  5. from from_user.email
  6. subject from_user.full_name+" Wants to Share a Photo With You."
  7. body :user => from_user,
  8. :photo => photo,
  9. :photo_url => url_for(:host => photo.project.domain, :action=>'view', :controller=>'photo', :id=>photo.id)
  10. #content_type "text/html"
  11. end
  12.  
  13. def share_with_many(recipient, from_user, photo)
  14.  
  15. recipients recipient.to_s
  16. from from_user.email
  17. subject from_user.full_name_plural+" photo needs your support!"
  18. body :user => from_user,
  19. :photo => photo,
  20. :photo_url => url_for(:host => photo.project.domain, :action=>'view', :controller=>'photo', :id=>photo.id)
  21. #content_type "text/html"
  22. end
  23.  
  24. def promote(recipient, from_user)
  25.  
  26. recipients recipient.to_s
  27. from from_user.email
  28. subject from_user.full_name+" wants you to join in the best of "+from_user.project.book_scope+"!"
  29. body :user => from_user,
  30. :photo => from_user.best_photo
  31. #content_type "text/html"
  32. end
  33.  
  34. def signup_thanks( user, password )
  35. # Email header info MUST be added here
  36. recipients user.email
  37. from "yourfriends@capturebook.com"
  38. subject "Thanks for signing up!"
  39. #content_type "text/html"
  40.  
  41. # Email body substitutions go here
  42. body :first_name => user.first_name, :last_name => user.last_name, :project => user.project, :username => user.login, :password => password
  43. end
  44.  
  45. def reset_password(user, password )
  46. # Email header info MUST be added here
  47. recipients user.email
  48. from "yourfriends@capturebook.com"
  49. subject "Your password has been reset! Here's a temporary one."
  50. #content_type "text/html"
  51.  
  52. # Email body substitutions go here
  53. body :user => user, :tmppass => password
  54. end
  55.  
  56. def report_offensive(photo, user=nil, ip=nil)
  57. recipients "admin@capturebook.com"
  58. from "yourfriends@capturebook.com"
  59. subject "**Possibly Offensive Photo**"
  60. #content_type "text/html"
  61.  
  62. body :photo => photo, :user => user, :ip => ip
  63. end
  64.  
  65. def report_offensive_comment(comment, user=nil, ip=nil)
  66. recipients "admin@capturebook.com"
  67. from "yourfriends@capturebook.com"
  68. subject "**Possibly Offensive Comment**"
  69. #content_type "text/html"
  70.  
  71. 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
  72. end
  73.  
  74. def contact_form(sender, body_text, project)
  75. if sender.nil? or sender.empty?
  76. sender = "yourfriends@capturebook.com"
  77. end
  78. recipients "admin@capturebook.com"
  79. from sender
  80. subject "Contact Form Submission -- #{project.title}"
  81.  
  82. body :text => body_text, :project => project, :sender => sender
  83. end
  84.  
  85. def bests_notice(user, chapter_photos)
  86. recipients user.email
  87. from "yourfriends@capturebook.com"
  88. subject "Congratulations "+user.first_name.titlecase+"! You have a great photo!"
  89. body :user => user,
  90. :chapter_photos => chapter_photos,
  91. :share_url => url_for(:host => user.project.domain, :action=>'promote', :controller=>'user')
  92. end
  93. end
Add Comment
Please, Sign In to add comment