Skip to content

Add support for line break in the body parameter.#1

Merged
piroor merged 1 commit intomainfrom
add-support-for-line-break-on-body-param
Feb 19, 2026
Merged

Add support for line break in the body parameter.#1
piroor merged 1 commit intomainfrom
add-support-for-line-break-on-body-param

Conversation

@HashidaTKS
Copy link
Contributor

"\n" in the body does not work if coercion type of a mail is HTML. We should convert it to HTML.

Test

  • Prepare the following TypicalReplyConfig.json
{
    "ConfigList": [
        {
            "Culture": "ja-JP",
            "GroupLabel": "定型返信",
            "ButtonConfigList": [
                {
                    "Id": "msgReadTypicalReply",
                    "Label": "いいね!",
                    "SubjectPrefix": "[[いいね!]]",
                    "Body": "いいね!\n\n改行",
                    "Recipients": [
                        "all"
                    ],
                    "QuoteType": true,
                    "RecipientsType": 3,
                    "AllowedDomains": [
                        "*"
                    ]
                }
            ]
        },
        {
            "Culture": "en",
            "GroupLabel": "Typical Reply",
            "ButtonConfigList": [
                {
                    "Id": "msgReadTypicalReply",
                    "Label": "Like!",
                    "SubjectPrefix": "[[Like!]]",
                    "Body": "Like!\n\nNew Line",
                    "Recipients": [
                        "all"
                    ],
                    "QuoteType": true,
                    "AllowedDomains": [
                        "*"
                    ]
                }
            ]
        }
    ]
}
  • Place TypicalReplyConfig.json to the config folder of the web server root
  • Side load the manifest file
  • Specify HTML for mail creation mode
image * Open any mail * Click the typical reply button * [x] Confirm that a new reply mail is created * [x] Confirm that body is broken into lines. ``` いいね!
改行
```
  • Close the new reply mail
  • Specify TEXT for mail creation mode
  • Open any mail
  • Click the typical reply button
    • Confirm that a new reply mail is created
    • Confirm that body is broken into lines.
      いいね!
      
      改行
      

"\n" in the body does not work if coercion type of a mail is HTML.
We should convert it to HTML.
@HashidaTKS HashidaTKS requested a review from piroor February 19, 2026 07:21
@piroor
Copy link
Member

piroor commented Feb 19, 2026

この実装だと本文テンプレートに文字装飾のタグなどは書けないということになりそうですが、そのように制約を加えても大丈夫でしょうか?
招待的にHTML対応の可能性も残しておくのなら、設定ファイルで本文をプレーンテキスト形式と指定したときだけこの変換を行い、本文をHTML形式と指定したら<br>をユーザーに明示的に書いてもらう必要がある仕様にする、という手もあると思いますが、どうでしょうか。

@HashidaTKS
Copy link
Contributor Author

HashidaTKS commented Feb 19, 2026

現状は本文テンプレートはHTMLを使わない想定でいます。

ユーザーがHTMLを書くことをサポートする場合、HTMLBodyというような別のプロパティを設定ファイルに追加して、作成しようとしているメールの本文の形式がプレーンテキスト形式ならBodyプロパティ、HTML形式ならHTMLBodyプロパティを使うというような分岐にするのが良いのではないかと思いました。(現在のBodyプロパティの内容をHTML形式に変換する機能はドロップする)
その場合、将来的に機能を拡張する場合も、現在のBodyプロパティはそのまま使えるので、影響は小さいかと思います。

@piroor
Copy link
Member

piroor commented Feb 19, 2026

了解です、その設計であれば問題ないと思います!

@piroor piroor merged commit fc45277 into main Feb 19, 2026
1 check passed
@HashidaTKS HashidaTKS deleted the add-support-for-line-break-on-body-param branch March 10, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants