Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. def tour_create
  2. @message = Message.new(params[:message])
  3. @message.type = "Tour"
  4. @message.save
  5.  
  6. if @message.valid?
  7. UserMailer.tour_signup(@message).deliver
  8. flash[:notice] = "Thank you for your interest in You'll receive an email from us confirming your participation in this Thursday's tour within 24- 48 hours."
  9. redirect_to("/tour/confirmed")
  10. else
  11. flash.now.alert = "Please fill all fields."
  12. render :tour_new
  13. end
  14. end
  15.  
  16. class UserMailer < ActionMailer::Base
  17. default from: "string"
  18.  
  19.  
  20. def tour_signup(message)
  21. @message = message
  22.  
  23. mail(:to => message.email,
  24. :cc => "string that is an email goes here",
  25. :subject => message.first_name + ", Let's Tour This Wednesday"
  26. )
  27. end
  28.  
  29. def orientation_signup(message, date)
  30. @message = message
  31. @date = date
  32.  
  33. mail(:to => message.email,
  34. :cc => "email",
  35. :subject => message.first_name + ",string that gets sent to users inbox
  36. )
  37. end
  38.  
  39. def ask_a_question(message)
  40. @message = message
  41.  
  42. mail(:to => "emailstringgoes here",
  43. :subject => message.first_name + " Has A Question"
  44. )
  45. end
  46.  
  47. def trial_kickoff_confirmation_to_user(message, type)
  48. @message = message
  49. @date = message.event_time.strftime("%l:%M %P, on %A, %B %-d")
  50. @type = type
  51. type_subject = type.split.map(&:capitalize).join(' ')
  52.  
  53. mail(:to => message.email,
  54. :subject => "Your #{type_subject} Has Been Scheduled!"
  55. )
  56. end
  57.  
  58. def trial_kickoff_confirmation_to_hosts(message, type)
  59. @message = message
  60. @date = message.event_time.strftime("%l:%M %P, on %A, %B %-d")
  61. @type = type
  62. type_subject = type.split.map(&:capitalize).join(' ')
  63.  
  64. if type == 'kick-off day'
  65. email = 'email'
  66. else
  67. email = 'email'
  68. end
  69.  
  70. mail(:to => email,
  71. :subject => "#{type_subject} for " + message.first_name + " " + message.last_name
  72. )
  73. end
  74.  
  75. def new_member_from_batchbook(member, password)
  76. @member = member
  77. @password = password
  78.  
  79. mail(:to => @email,
  80. #:cc => "emailgoes here string",
  81. :subject => "#{@first_name}, finish your profile at string.com!"
  82. )
  83. end
  84.  
  85.  
  86. def member_import_notification message, status
  87. @message = message
  88. @status = status
  89. mail(
  90. :to => 'email@string.com',
  91. #:cc => "email@string.com",
  92. :subject => "#{@message['first_name']}, import to email@string.com #{status}!"
  93. )
  94. end
  95.  
  96. def no_new_member_notification
  97. mail(
  98. :to => 'email@string.com',
  99. #:cc => "email@string.com",
  100. :subject => "Import ran. No new members!"
  101. )
  102. end
  103. end
  104.  
  105. bash -c 'echo "POSTMARK_API_TOKEN=`heroku config:get POSTMARK_API_TOKEN`" >> .env'
  106. bash -c 'echo "POSTMARK_SMTP_SERVER=`heroku config:get POSTMARK_SMTP_SERVER`" >> .env'
  107. bash -c 'echo "POSTMARK_INBOUND_ADDRESS=`heroku config:get POSTMARK_INBOUND_ADDRESS`" >> .env'
  108.  
  109. Hub::Application.configure do
  110. # Settings specified here will take precedence over those in config/application.rb
  111.  
  112. # Code is not reloaded between requests
  113. config.cache_classes = true
  114.  
  115. # Full error reports are disabled and caching is turned on
  116. config.consider_all_requests_local = false
  117. config.action_controller.perform_caching = true
  118.  
  119. # Disable Rails's static asset server (Apache or nginx will already do this)
  120. config.serve_static_assets = false
  121.  
  122.  
  123. # set what the default url for the mailer
  124. config.action_mailer.default_url_options = { :host => 'www.examplesite.com' }
  125.  
  126. # Compress JavaScripts and CSS
  127. config.assets.compress = true
  128. config.assets.js_compressor = :uglifier
  129.  
  130. # Don't fallback to assets pipeline if a precompiled asset is missed
  131. config.assets.compile = true
  132.  
  133. # Pre-compile for production
  134. config.assets.precompile += Ckeditor.assets
  135.  
  136. # Generate digests for assets URLs
  137. config.assets.digest = true
  138.  
  139. # Action mailer
  140. ActionMailer::Base.delivery_method = :smtp
  141. ActionMailer::Base.perform_deliveries = true
  142. ActionMailer::Base.raise_delivery_errors = true
  143.  
  144. # Send deprecation notices to registered listeners
  145. config.active_support.deprecation = :notify
  146.  
  147. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement