Skip to content

Commit

Permalink
通知でプレビューが確認できるようにSlack通知をテキストにした
Browse files Browse the repository at this point in the history
  • Loading branch information
oka4shi committed May 27, 2024
1 parent 01d1d6d commit f2c2422
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions gas/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,10 @@ class Webhook {
send(from: string, date: Date | GoogleAppsScript.Base.Date, subject: string) {
let body = {};
if (this.mode == "Slack") {
const content = `*送信元*: ${from} \n` + `*受信日時*: ${formatDate(date)}\n` + `*件名*: ${subject}`;
const content = [`*件名*: ${subject}`, `*送信元*: ${from}`, `*受信日時*: ${formatDate(date)}`].join("\n");

body = {
attachments: [
{
color: "#ed6d1f",
blocks: [
{
type: "section",
text: {
type: "mrkdwn",
text: content,
},
},
],
},
],
text: content,
};
} else if (this.mode == "Discord") {
body = {
Expand Down

0 comments on commit f2c2422

Please sign in to comment.