enmasse:一个实用程序来创建GMail邮件草稿从golang编译模板和JSON数据

网友投稿 769 2022-11-02

enmasse:一个实用程序来创建GMail邮件草稿从golang编译模板和jsON数据

enmasse:一个实用程序来创建GMail邮件草稿从golang编译模板和JSON数据

enmasse

enmasse (/ɑn ˈmæs/) is a utility application for creating GMail draft emails compiled from golang templates and JSON data.

enmasse is a very useful tool when you need to write almost-identical emails for a large group of recipients, but using a newsletter service like MailChimp would be overdoing it. Journalist reachouts, job applications, or promo code distribution are great usage examples.

Read more about enmasse at beckman.io/enmasse

Created by Pelle Beckman, beckman.io

ProTip: use Boomerang for GMail for scheduling emails.

Please don’t use enmasse for sending spam!

Installation

enmasse uses the Gmail APIs which require you to generate a personal credentials file.

Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials.On the Add credentials to your project page, click the Cancel button.At the top of the page, select the OAuth consent screen tab. Select an Email address, enter a Product name if not already set, and click the Save button.Select the Credentials tab, click the Create credentials button and select OAuth client ID.Select the application type Other, enter the name "Gmail API enmasse", and click the Create button.Click OK to dismiss the resulting dialog.Click the Download JSON button to the right of the client ID.Move this file to the same directory as the enmasse binary and rename it client_secret.json.

On first run enmasse will ask you to perform a one-time authentication

macOS

Binaries for macOS are available here

Linux & Windows

Usage on linux or windows currently requires building from source.

go build

Example usage

enmasse -template=template.tmpl -data=addresses.json

addresses.json:

[{ "first_name": "Alistair", "email": "alistair.hennessey@gmail.com", "subject": "DevStickers", "promocode": "L327GF11"}, { "first_name": "Klaus", "email": "klaus.daimler@gmail.com", "subject": "DevStickers", "promocode": "WH1S4KRS"}, { "first_name": "Ned", "email": "ned.plimpton@gmail.com", "subject": "DevStickers", "promocode": "AAC568FH"}]

template.txt:

Hey {{ .first_name }}DevStickers is an iMessage stickers pack for developers. It’s almost certainlythe only app on the App Store featuring a blue screen of death, and it’s oneof the most popular sticker packs on ProductHunt!As you’re a programmer I thought you might find it funny!If you do, a tweet would mean the world! {{ if .promocode }}Use this promo code: {{ .promocode }} {{ end }}Here’s the App Store link: https://itunes.apple.com/us/app/id1154505006 Best regards,Pellepelle@beckman.io

Flags

-template=FILE Template file-data=FILE JSON data file

Scheduling messages

A built-in scheduling function would be nice, but a) I feel it’s out of scope, b) it would require a lot of work and most likely require a backend of some sort, and c) Boomerang for GMail seems to work like a charm.

Contributing

Please report bugs or feature requests in the issue tracker at GitHub.

License

The MIT License (MIT)

Copyright (c) 2016 Pelle Beckman, http://beckman.io

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:1079 延迟的回文数 (20 分)
下一篇:【Azure微服务 Service Fabric 】如何转移Service Fabric集群中的种子节点(Seed Node)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~