Skip to content

Commit

Permalink
Merge pull request #155 from ttsukagoshi/main
Browse files Browse the repository at this point in the history
v3.0.4 release
  • Loading branch information
ttsukagoshi committed Feb 16, 2022
2 parents c9e84a5 + bebc65d commit 0977d42
Show file tree
Hide file tree
Showing 23 changed files with 8,613 additions and 1,012 deletions.
3 changes: 3 additions & 0 deletions .claspignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/**
!*.js
!appsscript.json
7 changes: 4 additions & 3 deletions .github/linters/.eslintrc.yml → .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

#############################
#############################
## JavaScript Linter rules ##
Expand All @@ -20,6 +19,7 @@ env:
globals:
# Atomics: readonly
# SharedArrayBuffer: readonly
CacheService: readonly
CalendarApp: readonly
CardService: readonly
DocumentApp: readonly
Expand All @@ -36,7 +36,7 @@ globals:
SpreadsheetApp: readonly
UrlFetchApp: readonly
Utilities: readonly

XmlService: readonly

###############
# Parser vars #
Expand All @@ -51,6 +51,7 @@ parserOptions:
###########
extends:
- 'eslint:recommended'
- 'plugin:prettier/recommended'
plugins:
- '@typescript-eslint'

Expand All @@ -59,4 +60,4 @@ plugins:
#########
rules:
no-useless-escape: warn
semi: error
semi: error
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] "
labels: bug
assignees: ttsukagoshi

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[NEW FEAT]"
labels: enhancement
assignees: ttsukagoshi

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'github-actions' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: 'monthly'
assignees:
- 'ttsukagoshi'
commit-message:
prefix: 'github-actions'
include: 'scope'
target-branch: 'main'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'monthly'
assignees:
- 'ttsukagoshi'
commit-message:
prefix: 'npm'
include: 'scope'
target-branch: 'main'
5 changes: 5 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
documentation:
- LICENSE
- README*.md
- docs/*
- docs/**/*
19 changes: 19 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler

name: Labeler
on: [pull_request]
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v3
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
6 changes: 4 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name: Lint Code Base
#############################
on:
push:
# branches-ignore: [main]
branches-ignore: [main]
# Remove the line above to run when pushing to master
pull_request:
branches: [main, release]
Expand Down Expand Up @@ -48,9 +48,11 @@ jobs:
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v3
uses: docker://ghcr.io/github/super-linter:slim-v4 # uses: github/super-linter@v4 See https://github.com/github/super-linter#images
env:
VALIDATE_ALL_CODEBASE: true
LINTER_RULES_PATH: /
VALIDATE_JAVASCRIPT_ES: true
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.yml
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80 changes: 80 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Publish Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest

env:
RELEASE_CLASPRC_ACCESS_TOKEN: ${{ secrets.RELEASE_CLASPRC_ACCESS_TOKEN }}
RELEASE_CLASPRC_CLIENT_ID: ${{ secrets.RELEASE_CLASPRC_CLIENT_ID }}
RELEASE_CLASPRC_CLIENT_SECRET: ${{ secrets.RELEASE_CLASPRC_CLIENT_SECRET }}
RELEASE_CLASPRC_EXPIRY_DATE: ${{ secrets.RELEASE_CLASPRC_EXPIRY_DATE }}
RELEASE_CLASPRC_ID_TOKEN: ${{ secrets.RELEASE_CLASPRC_ID_TOKEN }}
RELEASE_CLASPRC_REFRESH_TOKEN: ${{ secrets.RELEASE_CLASPRC_REFRESH_TOKEN }}
RELEASE_CLASP_SCRIPT_ID: ${{ secrets.RELEASE_CLASP_SCRIPT_ID }}

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '14'

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Create ~/.clasprc.json
run: |
echo $(cat <<-EOS
{
"token": {
"access_token": "${RELEASE_CLASPRC_ACCESS_TOKEN}",
"scope": "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/script.projects https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/service.management https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/script.webapp.deploy openid https://www.googleapis.com/auth/script.deployments https://www.googleapis.com/auth/logging.read https://www.googleapis.com/auth/drive.metadata.readonly",
"token_type": "Bearer",
"id_token": "${RELEASE_CLASPRC_ID_TOKEN}",
"expiry_date": ${RELEASE_CLASPRC_EXPIRY_DATE},
"refresh_token": "${RELEASE_CLASPRC_REFRESH_TOKEN}"
},
"oauth2ClientSettings": {
"clientId": "${RELEASE_CLASPRC_CLIENT_ID}",
"clientSecret": "${RELEASE_CLASPRC_CLIENT_SECRET}",
"redirectUri": "http://localhost"
},
"isLocalCreds": false
}
EOS
) > ~/.clasprc.json
- name: Create ~/.clasp.json
run: |
echo $(cat <<-EOS
{
"scriptId": "${RELEASE_CLASP_SCRIPT_ID}",
"rootDir": "./src"
}
EOS
) > ./.clasp.json
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- name: Upload files
run: npx @google/clasp push --force

- name: Deploy
run: npx @google/clasp deploy -d ${{ steps.get_version.outputs.VERSION }}
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# clasp-related files
.DS_Store

# clasp
.clasp.json
memo.clasp.json

# Node.js
node_modules/

# debugging
src/debug/
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tabWidth": 2,
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"endOfLine": "lf"
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.formatOnSave": true,
"files.eol": "\n",
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
23 changes: 15 additions & 8 deletions README.ja.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
# Group Merge: Gmailのための差し込みメール作成 ([English](https://github.com/ttsukagoshi/mail-merge-for-gmail) / 日本語)
[![Google Workspaceマーケットプレイスでこのアドオンを入手する](https://img.shields.io/badge/Google%20Workspace%20Add--on-Available-green)](https://workspace.google.com/marketplace/app/group_merge_mail_merge_for_gmail/586770229603) [![GitHub Super-Linter](https://github.com/ttsukagoshi/mail-merge-for-gmail/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter) [![Total alerts](https://img.shields.io/lgtm/alerts/g/ttsukagoshi/mail-merge-for-gmail.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ttsukagoshi/mail-merge-for-gmail/alerts/)
GmailとGoogleスプレッドシートを使って、受信者一人ひとり向けに宛名などを差し込んで作成。宛先リストで、宛先(メールアドレス)に重複がある場合、内容を1通のメールにまとめて送信できる **「まとめ差し込み(Group Merge)」** 機能つき。
# Group Merge: Gmail のための差し込みメール作成 ([English](https://github.com/ttsukagoshi/mail-merge-for-gmail) / 日本語)

[![Google Workspaceマーケットプレイスでこのアドオンを入手する](https://img.shields.io/badge/Google%20Workspace%20Add--on-Available-green?style=flat-square)](https://workspace.google.com/marketplace/app/group_merge_mail_merge_for_gmail/586770229603) [![GitHub Super-Linter](https://github.com/ttsukagoshi/mail-merge-for-gmail/workflows/Lint%20Code%20Base/badge.svg?style=flat-square)](https://github.com/marketplace/actions/super-linter) [![clasp](https://img.shields.io/badge/built%20with-clasp-4285f4.svg?style=flat-square)](https://github.com/google/clasp) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Gmail と Google スプレッドシートを使って、受信者一人ひとり向けに宛名などを差し込んで作成。宛先リストで、宛先(メールアドレス)に重複がある場合、内容を 1 通のメールにまとめて送信できる **「まとめ差し込み(Group Merge)」** 機能つき。

> **レガシー(スプレッドシート)版**
> Google Workspaceアドオンとして提供される前に公開していたレガシー版(スプレッドシート版)は現在、開発が停止しています。今後、Google側での仕様変更等により使用できなくなる可能性もありますので、ご注意ください。ソースコードやサンプルスプレッドシートを確認したい方のために[GitHub上のブランチ](https://github.com/ttsukagoshi/mail-merge-for-gmail/tree/legacy-v1.8.0-spreadsheet)を残していますので、必要に応じてご参照ください。
> Google Workspace アドオンとして提供される前に公開していたレガシー版(スプレッドシート版)は現在、開発が停止しています。今後、Google 側での仕様変更等により使用できなくなる可能性もありますので、ご注意ください。ソースコードやサンプルスプレッドシートを確認したい方のために[GitHub 上のブランチ](https://github.com/ttsukagoshi/mail-merge-for-gmail/tree/legacy-v1.8.0-spreadsheet)を残していますので、必要に応じてご参照ください。
## 概要

![Group Mergeのアイコン](https://lh3.googleusercontent.com/pw/ACtC-3eZPKFkzQJvMs2P_HgJIwNRSy1OGklUpOr0gm9ncC3OGcJw-nVvNUDYta6mMWo3d57gEc9KD_KV-UNOJvcTCBjGru3MG1KUpzP3z15I-bjEfT3u1V12mzRQrcA89pzb_RoIbINO3B1WxT4qP0KefNs=s96-no)
GmailとGoogleスプレッドシートを使って、宛名や会議の日時などの情報を宛先ごとに個別化したメールを作成して送信するための、オープンソースのGoogle Workspaceアドオン。
- 宛先リスト内に同じメールアドレスの宛先が2つ以上ある場合に、内容を1通のメールにまとめられる「**まとめ差し込み(Group Merge)**」機能つき。
- Gmailの下書きをテンプレートとして利用。**書式設定**(文字の色など)や**添付ファイル****CC**及び**BCC**、そして**Gmailラベル**が差し込み後のメールにも引き継がれる。
Gmail と Google スプレッドシートを使って、宛名や会議の日時などの情報を宛先ごとに個別化したメールを作成して送信するための、オープンソースの Google Workspace アドオン。

- 宛先リスト内に同じメールアドレスの宛先が 2 つ以上ある場合に、内容を 1 通のメールにまとめられる「**まとめ差し込み(Group Merge)**」機能つき。
- Gmail の下書きをテンプレートとして利用。**書式設定**(文字の色など)や**添付ファイル****CC**及び**BCC**、そして**Gmail ラベル**が差し込み後のメールにも引き継がれる。

## 使い方

本アドオンの詳細は、[ウェブサイト](https://www.scriptable-assets.page/ja/add-ons/group-merge/)をご覧ください。

## 利用規約

本アドオンの使用には、[利用規約(英)](https://www.scriptable-assets.page/ja/add-ons/group-merge/#%E5%88%A9%E7%94%A8%E8%A6%8F%E7%B4%84)への同意が必要です。

## アイコンの出典

The original icon of this add-on was made by [Freepik](https://www.freepik.com) from [www.flaticon.com](https://www.flaticon.com/) and its colors are modified to fit the theme color of the app.

## 謝辞
This work was inspired by [Tutorial: Simple Mail Merge (Google Apps Script Tutorial)](https://developers.google.com/apps-script/articles/mail_merge).

This work was inspired by [Tutorial: Simple Mail Merge (Google Apps Script Tutorial)](https://developers.google.com/apps-script/articles/mail_merge).
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
# Group Merge: Mail Merge for Gmail (English / [日本語](https://github.com/ttsukagoshi/mail-merge-for-gmail/blob/main/README.ja.md))
[![Get this add-on from Google Workspace Marketplace](https://img.shields.io/badge/Google%20Workspace%20Add--on-Available-green)](https://workspace.google.com/marketplace/app/group_merge_mail_merge_for_gmail/586770229603) [![GitHub Super-Linter](https://github.com/ttsukagoshi/mail-merge-for-gmail/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter) [![Total alerts](https://img.shields.io/lgtm/alerts/g/ttsukagoshi/mail-merge-for-gmail.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ttsukagoshi/mail-merge-for-gmail/alerts/)

[![Get this add-on from Google Workspace Marketplace](https://img.shields.io/badge/Google%20Workspace%20Add--on-Available-green?style=flat-square)](https://workspace.google.com/marketplace/app/group_merge_mail_merge_for_gmail/586770229603) [![GitHub Super-Linter](https://github.com/ttsukagoshi/mail-merge-for-gmail/workflows/Lint%20Code%20Base/badge.svg?style=flat-square)](https://github.com/marketplace/actions/super-linter) [![clasp](https://img.shields.io/badge/built%20with-clasp-4285f4.svg?style=flat-square)](https://github.com/google/clasp) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

An open-sourced Google Workspace Add-on to send personalized emails based on Gmail template to multiple recipients using Google Sheets. The **Group Merge** feature allows the sender to group the contents of two or more rows into one row for a single recipient.

> **Legacy Spreadsheet Version**
> The version 1 series, a legacy version preceding the current Google Workspace Add-on versions, is no longer maintained. It is available as [a GitHub branch](https://github.com/ttsukagoshi/mail-merge-for-gmail/tree/legacy-v1.8.0-spreadsheet) together with the sample spreadsheet.
## Overview

![Group Merge icon](https://lh3.googleusercontent.com/pw/ACtC-3eZPKFkzQJvMs2P_HgJIwNRSy1OGklUpOr0gm9ncC3OGcJw-nVvNUDYta6mMWo3d57gEc9KD_KV-UNOJvcTCBjGru3MG1KUpzP3z15I-bjEfT3u1V12mzRQrcA89pzb_RoIbINO3B1WxT4qP0KefNs=s96-no)
Send personalized emails based on Gmail template to multiple recipients using Gmail and Google Sheets. The namesake **Group Merge** feature allows the sender to group the contents of two or more rows into one email for a single recipient.

Similar to [the mail merge feature available in Microsoft Word](https://support.office.com/en-us/article/use-mail-merge-for-bulk-email-letters-labels-and-envelopes-f488ed5b-b849-4c11-9cff-932c49474705), **Group Merge** allows Gmail/Google Workspace users to send personalized emails to the recipients listed in a Google Sheets spreadsheet. Some notable features are:
Similar to [the mail merge feature available in Microsoft Word](https://support.office.com/en-us/article/use-mail-merge-for-bulk-email-letters-labels-and-envelopes-f488ed5b-b849-4c11-9cff-932c49474705), **Group Merge** allows Gmail/Google Workspace users to send personalized emails to the recipients listed in a Google Sheets spreadsheet. Some notable features are:

- **Group Merge** feature combines contents of two or more entries for the same recipient into a single email.
- Use Gmail drafts as template for mail merge. **HTML styling**, **file attachments**, **CC & BCC recipients**, and **Gmail labels** are preserved in the personalized emails.

## How to Use

Details of the add-on is described in the [app's web page](https://www.scriptable-assets.page/add-ons/group-merge/).

## Terms and Conditions

You must agree to the [Terms and Conditions](https://www.scriptable-assets.page/terms-and-conditions/) (TaC) to use this add-on. The [disclosure on privacy and OAuth scopes](https://www.scriptable-assets.page/add-ons/group-merge/#disclosure-on-privacy-and-oauth-scopes) constitutes part of this TaC.

## Attributes

The original icon of this add-on was made by [Freepik](https://www.freepik.com) from [www.flaticon.com](https://www.flaticon.com/) and its colors are modified to fit the theme color of the app.

## Acknowledgements

This work was inspired by [Tutorial: Simple Mail Merge (Google Apps Script Tutorial)](https://developers.google.com/apps-script/articles/mail_merge).
File renamed without changes.
Loading

0 comments on commit 0977d42

Please sign in to comment.