Ruby on rails rails mailer在同一邮件中生成html和文本
我在mailer controller中有一个方法,在平台上创建每条消息后发送电子邮件通知Ruby on rails rails mailer在同一邮件中生成html和文本,ruby-on-rails,actionmailer,Ruby On Rails,Actionmailer,我在mailer controller中有一个方法,在平台上创建每条消息后发送电子邮件通知 MailerClass.send_mail_notification(to, @conversation).deliver_now 我写了方法,写了视图(用html和纯文本) 然而,当邮件在测试中交付时,纯文本和html版本都放在邮件收集器的同一html选项卡中 ----==_mimepart_5e78cae1e1672_73fb2187fbc2829035 Content-Type: text/pla
MailerClass.send_mail_notification(to, @conversation).deliver_now
我写了方法,写了视图(用html和纯文本)
然而,当邮件在测试中交付时,纯文本和html版本都放在邮件收集器的同一html选项卡中
----==_mimepart_5e78cae1e1672_73fb2187fbc2829035 Content-Type: text/plain;
charset=UTF-8 Content-Transfer-Encoding: 7bit # Hi ...,
=======================
there was a new message from ... to ...:
how are you
Click here to see more: open interview
----==_mimepart_5e78cae1e1672_73fb2187fbc2829035 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit
----==_mimepart_5e78cae1e1672_73fb2187fbc2829035 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit #<InterviewRequest:0x00007f6430a062c0>
Hi ...,
there was a new message ...
---==_mimepart_...
---==\u mimepart\u 5E78CAE1672\u 73fb2187fbc2829035内容类型:文本/普通;
charset=UTF-8内容传输编码:7bit#Hi。。。,
=======================
有一条新消息来自。。。致……:
你好吗
单击此处查看更多信息:开放式面试
----==\u mimepart\u 5E78CAE1672\u 73fb2187fbc2829035内容类型:文本/普通;字符集=UTF-8内容传输编码:7bit
----==\u mimepart\u 5e78cae1e1672\u 73fb2187fbc289035内容类型:text/html;字符集=UTF-8内容传输编码:7bit#
你好
有一条新消息。。。
---==\u mimepart\u。。。
我注意到,这两种类型的mimepart是相同的。这是否让mailcatcher将这两封邮件识别为同一封邮件?如何为纯文本和html生成不同的mimetype,以便将它们分开
有人有类似的情况或对此有任何想法吗?
谢谢
----==_mimepart_5e78cae1e1672_73fb2187fbc2829035 Content-Type: text/plain;
charset=UTF-8 Content-Transfer-Encoding: 7bit # Hi ...,
=======================
there was a new message from ... to ...:
how are you
Click here to see more: open interview
----==_mimepart_5e78cae1e1672_73fb2187fbc2829035 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit
----==_mimepart_5e78cae1e1672_73fb2187fbc2829035 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit #<InterviewRequest:0x00007f6430a062c0>
Hi ...,
there was a new message ...
---==_mimepart_...