actionmailer

Sending email with attachments

梦想与她 提交于 2019-12-23 09:16:02
问题 I've got a mailer that as follows: class Payments::LateNoticesMailer < AsyncMailer def notice(payment_id) @payment = PaymentDecorator.find(payment_id) @invoice = @payment.invoice template = "payments/invoices/#{@payment.made_with_type.downcase}/show" attachments["#{@payment.invoice_filename}.pdf"] = WickedPdf.new.pdf_from_string( render_to_string( pdf: @payment.invoice_filename, formats: [:pdf], template: template, layout: "layouts/pdf.html")) mail to: @payment.payer_email, from: '

Rails 4, Devise & Mandrill emails

匆匆过客 提交于 2019-12-23 07:47:06
问题 I'm trying to make an app in Rails 4. For the past 3 years, I've been struggling to figure out devise/omniauth (I am still trying to get it to work). Stepping aside from the main problems while I try and find the will to live through this, I've tried to setup emails with Mandrill. I found this tutorial, which I am trying to follow along: https://nvisium.com/blog/2014/10/08/mandrill-devise-and-mailchimp-templates/ I have a mailer called mandrill_devise_mailer.rb class MandrillDeviseMailer <

Send an email through gmail but configure a different email address

左心房为你撑大大i 提交于 2019-12-23 03:21:53
问题 I'm trying to send emails from my rails application using GMail's smtp server. The emails I send appear like sent from my own gmail address, while I would like them to be coming from info@myapp.com. I've configured the thing using the three ways authentication, and my app has got its unique password. Here's my production.rb config.action_mailer.default_url_options = { host: 'my ip', protocol: 'https' } config.action_mailer.delivery_method = :smtp config.action_mailer.asset_host = "https://my

Receiving and Processing Email: Heroku, Sendgrid, and possibly Mailman

半世苍凉 提交于 2019-12-22 18:47:31
问题 My app creates a unique email for each user, and users send email to that address for processing. Using Sendgrid, I've piped incoming emails to my domain (hosted on Heroku) to an address: site.com/receive_email I use the TO field to determine the user, since the email address is randomly generated. I've experimented using an external script like Mailman, but since I'm hosted on Heroku I'd need to have a worker running full time to keep this process going. Not really looking for that at the

How to modify actionmailer email html_part before sending

雨燕双飞 提交于 2019-12-22 17:46:10
问题 I have everything at the point where I'm about to send out the email but I need to modify all links to include Google Analytics attributes. The problem is that if I try and read/write the html_part.body of the email, the entire html string somehow becomes encoded and doesn't display the email properly (i.e. <html> becomes <html> ). I have logged the html_part.body.raw_source in the logger and it shows as proper unencoded HTML, it's only when the email is actually sent does the encoding occur.

Sending Pdf via email in Rails

别说谁变了你拦得住时间么 提交于 2019-12-22 14:05:47
问题 emp_ids = params[:employee_ids] I am working on a project in rails where i have an Employee List page,This list is the List of Salaryslip of an employee.In that list i have applied checkboxes and at the bottom there is an Send button.I want that if i select multiple checkboxes,Email should be gone to all the employees including the pdf of salary slip.I am able to do this if i select checkbox the on clicking on submit all the salaryslip come for the employee who i have selected but in that pdf

Rpsec tests failed with 'rspec' but not with 'rspec path_of_the_file'

不羁的心 提交于 2019-12-22 10:13:12
问题 If I run this command "rspec ./spec/requests/api/v1/password_reset_request_spec.rb" all the test inside this file pass. However when I run "rspec" I've a faillure on the tests inside this file. 1) /api/v1/password_reset #request when the email match with a runner when there is no request pending create a token for reset the password Failure/Error: post("/api/v1/password_reset/request", @params) NoMethodError: undefined method `reset_password' for RunnerMailer:Class # ./app/services/password

Rails ActionMailer w/ Devise + Google Apps in Development Mode

ぃ、小莉子 提交于 2019-12-22 08:11:46
问题 I'm trying to configure ActionMailer to send mail from Devise in development mode with my Google Apps account. I've added the following to my config/environments/development.rb file, but it looks like mail is not being sent. Note: this is for Google Apps, not Gmail (but the Gmail servers should work -- they do in my mail client). Anything jump out as strange in my config? config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :enable_starttls_auto => true,

Rails - Use same attachment for all emails using layout

风格不统一 提交于 2019-12-22 05:06:47
问题 I'm probably missing something obvious, but I've got a logo I'd like to include in all of the emails I send from my app. I have a master layout I'm using for all of those Mailers. I assume there's a way to do keep it DRY and not have to add the line of code to attach the file in every mailer method. Can someone point me in the right direction or correct my line of thought. Thanks! 回答1: Callbacks using before_filter and after_filter will be supported in a future Rails release: http://github

How to install Refinery CMS using Rails 4

拥有回忆 提交于 2019-12-21 16:55:56
问题 I previously never had a problem with Refinery. I was refreshing my knowledge by following along to the tutorial http://railscasts.com/episodes/332-refinery-cms-basics .Then when I created a new app with Refinery CMS, I got this error Bundler could not find compatible versions for gem "actionmailer": In Gemfile: refinerycms (~> 2.1.0) ruby depends on actionmailer (< 3.3, >= 3.1.3) ruby rails (= 4.0.0) ruby depends on actionmailer (4.0.0) But should not these things be there by default with