mailer

Rails mailer mimepart visible as text in message body

一世执手 提交于 2019-12-04 11:18:46
问题 I'm sending test mail using ActionMailer. The template is being rendered and mail is being delivered fine. The only problem is the mimepart and other header data is displayed by Google in message body. Here is the code that mails.. def testing mail(:to => "apoorvparijat@gmail.com",:subject => "html mailer", :content_type => "text/html") do |format| format.html { render 'testing' } format.text { render :text => "bing" } end end and Here's the email received. ----==_mimepart_508fd46252b8c

Swift Mailer attachments

跟風遠走 提交于 2019-12-04 11:10:27
I'm creating a CSV on the fly with PHP, I then need to attach this CSV file to the the Swift Mailer Message. I have tried using file_get_content on the created file aswell as using chunk_split(base64_encode(file_get_contents()) on the created file aswell as attaching the file before writing it to disk. Without writing to disk I get Rescource #183 in the CSV, with attaching it with file_get_content I get just a string in each row of the CSV file, anyone know what I'm doing wrong? if(!file_exists(_PS_ORDERS_DIR_.$orderDate.'/'.$file_name.'.csv')) { if($file = fopen (_PS_ORDERS_DIR_.$orderDate.'/

Make a custom helper available to both Mailer and View in Rails 3.1

烂漫一生 提交于 2019-12-03 15:43:38
问题 is this the best way to make a helper available to both Mailer and view in Rails 3.1? class EventMailer < ActionMailer::Base include MailerHelper helper :mailer I tried helper :mailer on its own, but that didn't allow me to use the helpers in the EventMailer class. I tried add_template_helper(MailerHelper) but had the same problem. 回答1: The rails helpers are supposed to be view helpers. You will notice that the following code : class MyController < ApplicationController helper :my end will

Rails mailer mimepart visible as text in message body

自闭症网瘾萝莉.ら 提交于 2019-12-03 07:01:49
I'm sending test mail using ActionMailer. The template is being rendered and mail is being delivered fine. The only problem is the mimepart and other header data is displayed by Google in message body. Here is the code that mails.. def testing mail(:to => "apoorvparijat@gmail.com",:subject => "html mailer", :content_type => "text/html") do |format| format.html { render 'testing' } format.text { render :text => "bing" } end end and Here's the email received. ----==_mimepart_508fd46252b8c_8023fe595835ad0479a6 Date: Tue, 30 Oct 2012 18:51:38 +0530 Mime-Version: 1.0 Content-Type: text/plain;

Rails: UTF-8 encoding issue with mailer and text partials

夙愿已清 提交于 2019-12-02 18:22:51
问题 I am building a Rails application and am face of a problem with my text mailer: I can’t find how to make special character (é, è, à, …) to be encoded properly. It works great with html mailer because I can set the <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> but that’s not possible with text mailer. Example of issue in text mailer (my_mailer.text.erb) Démonstration # Démonstration Extract of my mailer : mail from: <from>, to: <to>, subject: <subject>, body: <body> I

Rails: UTF-8 encoding issue with mailer and text partials

自闭症网瘾萝莉.ら 提交于 2019-12-02 07:39:56
I am building a Rails application and am face of a problem with my text mailer: I can’t find how to make special character (é, è, à, …) to be encoded properly. It works great with html mailer because I can set the <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> but that’s not possible with text mailer. Example of issue in text mailer (my_mailer.text.erb) Démonstration # Démonstration Extract of my mailer : mail from: <from>, to: <to>, subject: <subject>, body: <body> I also tried to add charset: 'utf-8' property to the mail method without success either. How can I fix

asset_url in mailer on rails 3.1

别等时光非礼了梦想. 提交于 2019-11-30 13:27:06
问题 I have my mailer on rails 3.1 which has an inline attachment. To open that attachment i use this code: attachments["rails.png"] = File.read("#{Rails.root}/app/assets/images/Rails.png") is there a way to change that with something like assets_url ? 回答1: If I understand correctly, you want to use the asset pipeline's search functionality to locate the local path for a given asset so you don't have to hard-code which directory it's in. If that's the case, you want to do this: <YourAppName>:

asset_url in mailer on rails 3.1

自古美人都是妖i 提交于 2019-11-30 07:13:39
I have my mailer on rails 3.1 which has an inline attachment. To open that attachment i use this code: attachments["rails.png"] = File.read("#{Rails.root}/app/assets/images/Rails.png") is there a way to change that with something like assets_url ? If I understand correctly, you want to use the asset pipeline's search functionality to locate the local path for a given asset so you don't have to hard-code which directory it's in. If that's the case, you want to do this: <YourAppName>::Application.assets.find_asset('Rails.png').pathname This will locate the asset using standard pipeline/sprockets

php mailer and html includes with php variables

痴心易碎 提交于 2019-11-30 06:26:08
问题 Hello I am trying to send html emails using php mailer class. The problem is i would like to incllude php variables in my email while using includes as to keep things organized. Heres my php mailer.... $place = $data['place']; $start_time = $data['start_time']; $mail->IsHTML(true); // set email format to HTML $mail->Subject = "You have an event today"; $mail->Body = file_get_contents('../emails/event.html'); $mail->Send(); // send message my question is, is it possible to have php variables

How to change “Devise: password reset instruction email's subject”

情到浓时终转凉″ 提交于 2019-11-28 22:55:20
I'm just unable to change "password reset instruction" email's subject. I have changed notifer.rb in Mailer to overwrite Devise default email subject. But it's not working. Here in my application there is default Email subject inside Devise .yml file. But I want to make it dynamic to change it by pulling data from DB. you can change it in devise.en.yml file in intilizer directory And set your own subject for any mailer mailer: confirmation_instructions: subject: 'Confirmation instructions' reset_password_instructions: subject: 'Reset password instructions' unlock_instructions: subject: 'Unlock