2011-06-28
Rails3のActionMailer(gem mail)でISO-2022-JPなメールを送信するプラグイン「mail_ja」
mail_jaといいます
Ruby on Rails 3.x 系のActionMailerでISO-2022-JPなエンコードのメールを送ることができるようになるプラグインです。
インストールしてcharsetをISO-2022-JPに設定するだけで自動的に変換します。 エンコードを意識する必要が無く、コード量が少なくて済みます。
配布場所 / Download
https://github.com/ma2shita/mail_ja
インストール / Install
$ cd RAILS_ROOT $ rails plugin install http://github.com/ma2shita/mail_ja.git
もしくは
$ cd RAILS_ROOT $ git submodule add http://github.com/ma2shita/mail_ja.git vendor/plugins/mail_ja/
使い方 / Usage
charsetにISO-2022-JPをセットすると、pluginが動きます。
それ以外の場合は、ActionMailer(mail)の標準の挙動です。
class UserMailer < ActionMailer::Base :charset => 'ISO-2022-JP' def hoge ... end end
バグ、未確認事項/ Issues
- Body と Subject しかエンコードしません。Fromとか他のヘッダはそのうちやります。
- 添付ファイルの挙動については不明。
あとがき
GmailやGoogle Readerのようなカーソル移動できるjQueryプラグイン「Cursor jQuery Plugin」もよろしくお願いします。
トラックバック - http://d.hatena.ne.jp/fujisan3776/20110628/1309255427
リンク元
- 59 http://pipes.yahoo.com/pipes/pipe.info?_id=tDfBdGWF3RGl9XNm1L3fcQ
- 9 http://htn.to/j5EZSH
- 8 http://pipes.yahoo.com/pipes/pipe.info?_id=12e453e301454b799b3ac6642aa089b5
- 7 http://reader.livedoor.com/reader/
- 7 http://www.google.co.jp/url?sa=t&source=web&cd=1&ved=0CBkQFjAA&url=http://d.hatena.ne.jp/fujisan3776/20090529/1243612244&rct=j&q=タスク切り替え mac&ei=epkKTs27FqudmQWP5OSmAQ&usg=AFQjCNEQ0Jf9EK
- 6 http://bit.ly/kT36sE
- 6 http://search.yahoo.co.jp/search?p=puk認証&search.x=1&fr=top_ga1_sa&tid=top_ga1_sa&ei=UTF-8&aq=&oq=
- 6 http://t.co/rTb31iv
- 6 http://www.google.co.jp/search?sourceid=navclient&hl=ja&ie=UTF-8&rlz=1T4ADRA_jaJP426JP426&q=solaris 起動しない
- 5 http://bit.ly/ixEI3l
