私はRails 2.3.8アプリを持っており、通知機能はapp/models/hello_notifier.rb
次のようになっています:
class HelloNotifier < ActionMailer::Base
def hello_world
@recipients = 'to@email.address'
@from = 'from@email@address'
@subject = 'Hello world'
end
end
そして、そのビューはapp/views/hello_notifier/hello_world.erb
次のようになります。
Hello
World
を実行したときではなくHelloNotifier.deliver_hello_world
、メールを配信しますが、プレーンと HTML のバリエーションを含むマルチパート メールとして配信します。
@content_type = 'text/plain'
通知モデルと同様に追加しようとしましたcontent_type 'text/plain'
。ActionMailer::Base.default_content_type = 'text/plain'
また、アクションメーラーの初期化子に追加しようとしました。また、ビューの名前を に変更しようとしましたhello_world.text.plain.erb
。私が試したことは何も役に立たないようです。メールは常にマルチパートの html/text メールとして送信されます。
「テキスト/プレーン」として送信するように強制する方法についてのアイデアはありますか?