1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
| function getArticles() { return [ { title: "n8n If 和 Switch", link: "https://www.darrelltw.com/n8n-if-switch", description: "深入了解 n8n 的 If 和 Switch 節點,條件判斷是每個自動化腳本都會遇到的。", }, { title: "n8n 串接 Slack、發送訊息、用 Slack 觸發 workflow", link: "https://www.darrelltw.com/n8n-slack-workflow", description: "Slack 是多人常用的通訊工具,用 n8n 串接 Slack 的教學對非技術人員十分友好。", }, { title: "CompressX MacOS 強大的壓縮圖片工具(需付費)", link: "https://www.darrelltw.com/compressx-macos", description: "CompressX 是壓縮圖片的好工具,操作簡單且壓縮率高,非常值得價格。", }, { title: "在 Klaviyo 使用 Gmail 促銷標註顯示折扣碼", link: "https://www.darrelltw.com/klaviyo-gmail-promotion", description: "學習如何在 Gmail 促銷標註中顯示折扣碼或活動圖片的操作。", }, { title: "ChatGPT 新功能 - Work with Apps 一起運作", link: "https://www.darrelltw.com/chatgpt-work-with-apps", description: "讓 ChatGPT 讀取 VSCode 程式碼,並透過終端機自動執行測試。", }, { title: "利用 Bouncer 來清理電子報的無效用戶", link: "https://www.darrelltw.com/bouncer-clean-email", description: "使用 Bouncer 清理無效 Email 用戶,提升電子報寄送成功率和開信率。", }, { title: "利用 Google App Script 串接 Threads API 並且用 Looker Studio 視覺化", link: "https://www.darrelltw.com/threads-api-google-app-script", description: "使用 Google App Script 處理 Threads API,並在 Looker Studio 中視覺化。", }, { title: "GA4 更新 - Benchmark - 產業資料的基準比較", link: "https://www.darrelltw.com/ga4-benchmark-update", description: "GA4 新功能 Benchmark 提供產業基準比較,檢視自身表現。", }, { title: "Line Notify 結束服務,轉移到 Slack、Telegram、Discord", link: "https://www.darrelltw.com/line-notify-end-service", description: "Line Notify 停止服務,介紹替代方案與串接方式。", }, { title: "GA4 電子商務報表-已購買的商品數為 0", link: "https://www.darrelltw.com/ga4-ecommerce-issues", description: "GA4 電子商務案例,商品數量顯示為 0 的原因與解決方法。", } ]; }
function sendArticleListEmail() { const articles = getArticles(); const recipient = "darrell.tw.martech@gmail.com"; const subject = "每週精選文章推薦";
let articleItems = ""; articles.forEach(article => { articleItems += ` <li class="article-item"> <a href="${article.link}" class="article-title">${article.title}</a> <p class="article-description">${article.description}</p> </li> `; });
const emailHtml = HtmlService.createTemplateFromFile('emailTemplate'); emailHtml.articleItems = articleItems;
const htmlOutput = emailHtml.evaluate().getContent();
GmailApp.sendEmail(recipient, subject, "", { htmlBody: htmlOutput }); }
|