mailmerge


Namemailmerge JSON
Version 2.2.4 PyPI version JSON
download
home_pageNone
SummaryA simple, command line mail merge tool
upload_time2024-10-31 19:38:41
maintainerNone
docs_urlNone
authorAndrew DeOrio
requires_python>=3.6
licenseThe MIT License (MIT) Copyright (c) 2016 Andrew DeOrio 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.
keywords mail merge mailmerge email
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Mailmerge
=========

[![CI main](https://github.com/awdeorio/mailmerge/workflows/CI/badge.svg?branch=develop)](https://github.com/awdeorio/mailmerge/actions?query=branch%3Adevelop)
[![codecov](https://codecov.io/gh/awdeorio/mailmerge/branch/develop/graph/badge.svg)](https://codecov.io/gh/awdeorio/mailmerge)
[![PyPI](https://img.shields.io/pypi/v/mailmerge.svg)](https://pypi.org/project/mailmerge/)

A simple, command line mail merge tool.

`mailmerge` uses plain text files and the [jinja2 template engine](http://jinja.pocoo.org/docs/latest/templates/).

**Table of Contents**
- [Quickstart](#quickstart)
- [Install](#install)
- [Example](#example)
- [Advanced template example](#advanced-template-example)
- [HTML formatting](#html-formatting)
- [Markdown formatting](#markdown-formatting)
- [Attachments](#attachments)
- [Inline Image Attachments](#inline-image-attachments)
- [Contributing](#contributing)
- [Acknowledgements](#acknowledgements)

## Quickstart
```console
$ pipx install mailmerge
$ pipx ensurepath
$ mailmerge
```

`mailmerge` will guide you through the process.  Don't worry, it won't send real emails by default.

## Install
System-wide install.
```console
$ pipx install mailmerge
$ pipx ensurepath
```

Fedora package install.
```console
$ sudo dnf install python3-mailmerge
```

## Example
This example will walk you through the steps for creating a template email, database and STMP server configuration.  Then, it will show how to test it before sending real emails.

### Create a sample template email, database, and config
```console
$ mailmerge --sample
Created sample template email "mailmerge_template.txt"
Created sample database "mailmerge_database.csv"
Created sample config file "mailmerge_server.conf"

Edit these files, then run mailmerge again.
```

### Edit the SMTP server config `mailmerge_server.conf`
The defaults are set up for GMail.  Be sure to change your username.  If you use 2-factor authentication, create an [app password](https://support.google.com/accounts/answer/185833?hl=en) first.  Other configuration examples are in the comments of `mailmerge_server.conf`.

**Pro-tip:** SSH or VPN into your network first.  Running mailmerge from the same network as the SMTP server can help you avoid spam filters and server throttling.  This tip doesn't apply to Gmail.
```
[smtp_server]
host = smtp.gmail.com
port = 465
security = SSL/TLS
username = YOUR_USERNAME_HERE
```

### Edit the template email message `mailmerge_template.txt`
The `TO`, `SUBJECT`, and `FROM` fields are required.  The remainder is the body of the message.  Use `{{ }}` to indicate customized parameters that will be read from the database.  For example, `{{email}}` will be filled in from the `email` column of `mailmerge_database.csv`.
```
TO: {{email}}
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>

Hi, {{name}},

Your number is {{number}}.
```

### Edit the database `mailmerge_database.csv`
Notice that the first line is a header that matches the parameters in the template example, for example, `{{email}}`.

**Pro-tip**: Add yourself as the first recipient.  This is helpful for testing.
```
email,name,number
myself@mydomain.com,"Myself",17
bob@bobdomain.com,"Bob",42
```

### Dry run
First, dry run one email message (`mailmerge` defaults).  This will fill in the template fields of the first email message and print it to the terminal.
```console
$ mailmerge
>>> message 1
TO: myself@mydomain.com
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Thu, 19 Dec 2019 19:49:11 -0000

Hi, Myself,

Your number is 17.
>>> sent message 1
>>> Limit was 1 message.  To remove the limit, use the --no-limit option.
>>> This was a dry run.  To send messages, use the --no-dry-run option.
```

If this looks correct, try a second dry run, this time with all recipients using the `--no-limit` option.
```console
$ mailmerge --no-limit
>>> message 1
TO: myself@mydomain.com
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Thu, 19 Dec 2019 19:49:33 -0000

Hi, Myself,

Your number is 17.
>>> sent message 1
>>> message 2
TO: bob@bobdomain.com
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Thu, 19 Dec 2019 19:49:33 -0000

Hi, Bob,

Your number is 42.
>>> sent message 2
>>> This was a dry run.  To send messages, use the --no-dry-run option.
```

### Send first email
We're being extra careful in this example to avoid sending spam, so next we'll send *only one real email* (`mailmerge` default).  Recall that you added yourself as the first email recipient.
```console
$ mailmerge --no-dry-run
>>> message 1
TO: myself@mydomain.com
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Thu, 19 Dec 2019 19:50:24 -0000

Hi, Myself,

Your number is 17.
>>> sent message 1
>>> Limit was 1 message.  To remove the limit, use the --no-limit option.
```

You may have to type your email password when prompted. (If you use GMail with 2-factor authentication, don't forget to use the [app password](https://support.google.com/accounts/answer/185833?hl=en) you created while [setting up the SMTP server config](#edit-the-smtp-server-config-mailmerge_serverconf).)

Now, check your email and make sure the message went through.  If everything looks OK, then it's time to send all the messages.

### Send all emails
```console
$ mailmerge --no-dry-run --no-limit
>>> message 1
TO: myself@mydomain.com
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Thu, 19 Dec 2019 19:51:01 -0000

Hi, Myself,

Your number is 17.
>>> sent message 1
>>> message 2
TO: bob@bobdomain.com
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Thu, 19 Dec 2019 19:51:01 -0000

Hi, Bob,

Your number is 42.
>>> sent message 2
```

## Advanced template example
This example will send progress reports to students.  The template uses more of the advanced features of the [jinja2 template engine documentation](http://jinja.pocoo.org/docs/latest/templates/) to customize messages to students.

#### Template `mailmerge_template.txt`
```
TO: {{email}}
SUBJECT: EECS 280 Mid-semester Progress Report
FROM: My Self <myself@mydomain.com>
REPLY-TO: My Reply Self <myreplyself@mydomain.com>

Dear {{name}},

This email contains our record of your grades EECS 280, as well as an estimated letter grade.

Project 1: {{p1}}
Project 2: {{p2}}
Project 3: {{p3}}
Midterm exam: {{midterm}}

At this time, your estimated letter grade is {{grade}}.

{% if grade == "C-" -%}
I am concerned that if the current trend in your scores continues, you will be on the border of the pass/fail line.

I have a few suggestions for the rest of the semester.  First, it is absolutely imperative that you turn in all assignments.  Attend lecture and discussion sections.  Get started early on the programming assignments and ask for help.  Finally, plan a strategy to help you prepare well for the final exam.

The good news is that we have completed about half of the course grade, so there is an opportunity to fix this problem.  The other professors and I are happy to discuss strategies together during office hours.
{% elif grade in ["D+", "D", "D-", "E", "F"] -%}
I am writing because I am concerned about your grade in EECS 280.  My concern is that if the current trend in your scores continues, you will not pass the course.

If you plan to continue in the course, I urge you to see your instructor in office hours to discuss a plan for the remainder of the semester.  Otherwise, if you plan to drop the course, please see your academic advisor.
{% endif -%}
```

#### Database `mailmerge_database.csv`
Again, we'll use the best practice of making yourself the first recipient, which is helpful for testing.
```
email,name,p1,p2,p3,midterm,grade
myself@mydomain.com,"My Self",100,100,100,100,A+
borderline@fixme.com,"Borderline Name",50,50,50,50,C-
failing@fixme.com,"Failing Name",0,0,0,0,F
```

## HTML formatting
Mailmerge supports HTML formatting.

### HTML only
This example will use HTML to format an email.  Add `Content-Type: text/html` just under the email headers, then begin your message with `<html>`.

#### Template `mailmerge_template.txt`
```
TO: {{email}}
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
Content-Type: text/html

<html>
<body>

<p>Hi, {{name}},</p>

<p>Your number is {{number}}.</p>

<p>Sent by <a href="https://github.com/awdeorio/mailmerge">mailmerge</a></p>

</body>
</html>
```


### HTML and plain text
This example shows how to provide both HTML and plain text versions in the same message.  A user's mail reader can select either one.

#### Template `mailmerge_template.txt`
```
TO: {{email}}
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="boundary"

This is a MIME-encoded message. If you are seeing this, your mail
reader is old.

--boundary
Content-Type: text/plain; charset=us-ascii

Hi, {{name}},

Your number is {{number}}.

Sent by mailmerge https://github.com/awdeorio/mailmerge

--boundary
Content-Type: text/html; charset=us-ascii

<html>
<body>

<p>Hi, {{name}},</p>

<p>Your number is {{number}}.</p>

<p>Sent by <a href="https://github.com/awdeorio/mailmerge">mailmerge</a></p>

</body>
</html>
```


## Markdown formatting
Mailmerge supports [Markdown](https://daringfireball.net/projects/markdown/syntax) formatting by including the custom custom header `Content-Type: text/markdown` in the message. Mailmerge will render the markdown to HTML, then include both HTML and plain text versions in a multiplart message. A recipient's mail reader can then select either format.

### Template `mailmerge_template.txt`
```
TO: {{email}}
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
CONTENT-TYPE: text/markdown

You can add:

- Emphasis, aka italics, with *asterisks*.
- Strong emphasis, aka bold, with **asterisks**.
- Combined emphasis with **asterisks and _underscores_**.
- Unordered lists like this one.
- Ordered lists with numbers:
    1. Item 1
    2. Item 2
- Preformatted text with `backticks`.
- How about some [hyperlinks](http://bit.ly/eecs485-wn19-p6)?

# This is a heading.
## And another heading.

Here's an image not attached with the email:
![python logo not attached](http://pluspng.com/img-png/python-logo-png-open-2000.png)
```

## Attachments
This example shows how to add attachments with a special `ATTACHMENT` header.

#### Template `mailmerge_template.txt`
```
TO: {{email}}
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
ATTACHMENT: file1.docx
ATTACHMENT: ../file2.pdf
ATTACHMENT: /z/shared/{{name}}_submission.txt

Hi, {{name}},

This email contains three attachments.
Pro-tip: Use Jinja to customize the attachments based on your database!
```

Dry run to verify attachment files exist. If an attachment filename includes a template, it's a good idea to dry run with the `--no-limit` flag.
```console
$ mailmerge
>>> message 1
TO: myself@mydomain.com
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>

Hi, Myself,

This email contains three attachments.
Pro-tip: Use Jinja to customize the attachments based on your database!

>>> attached /Users/awdeorio/Documents/test/file1.docx
>>> attached /Users/awdeorio/Documents/file2.pdf
>>> attached /z/shared/Myself_submission.txt
>>> sent message 1
>>> This was a dry run.  To send messages, use the --no-dry-run option.
```

## Inline Image Attachments

This example shows how to add inline-image-attachments so that the images are rendered directly in the email body. You **must** add the inline-image as an attachment before referencing it in the body.

#### HTML Example: Template `mailmerge_template.txt`

```
TO: {{email}}
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
Content-Type: text/html
ATTACHMENT: image.jpg
ATTACHMENT: second/image.jpg

<html>
<body>

<p>Hi, {{name}},</p>

<img alt="Sample image" src="image.jpg" />

The second image: <img alt="second" src="second/image.jpg">

<p>Sent by <a href="https://github.com/awdeorio/mailmerge">mailmerge</a></p>

</body>
</html>
```

#### Markdown Example: Template `mailmerge_template.txt`
```
TO: {{email}}
SUBJECT: Testing mailmerge
FROM: My Self <myself@mydomain.com>
ATTACHMENT: image.jpg
CONTENT-TYPE: text/markdown

Hi, {{name}},

![image alt-description](image.jpg)
```

## Contributing
Contributions from the community are welcome! Check out the [guide for contributing](CONTRIBUTING.md).


## Acknowledgements
Mailmerge is written by Andrew DeOrio <awdeorio@umich.edu>, [http://andrewdeorio.com](http://andrewdeorio.com).  Sesh Sadasivam (@seshrs) contributed many features and bug fixes.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mailmerge",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "mail merge, mailmerge, email",
    "author": "Andrew DeOrio",
    "author_email": "awdeorio@umich.edu",
    "download_url": "https://files.pythonhosted.org/packages/76/a2/1273e0d55445dab0cb7ed29813d1daf56218017940f932dd87a1ba28e7dd/mailmerge-2.2.4.tar.gz",
    "platform": null,
    "description": "Mailmerge\n=========\n\n[![CI main](https://github.com/awdeorio/mailmerge/workflows/CI/badge.svg?branch=develop)](https://github.com/awdeorio/mailmerge/actions?query=branch%3Adevelop)\n[![codecov](https://codecov.io/gh/awdeorio/mailmerge/branch/develop/graph/badge.svg)](https://codecov.io/gh/awdeorio/mailmerge)\n[![PyPI](https://img.shields.io/pypi/v/mailmerge.svg)](https://pypi.org/project/mailmerge/)\n\nA simple, command line mail merge tool.\n\n`mailmerge` uses plain text files and the [jinja2 template engine](http://jinja.pocoo.org/docs/latest/templates/).\n\n**Table of Contents**\n- [Quickstart](#quickstart)\n- [Install](#install)\n- [Example](#example)\n- [Advanced template example](#advanced-template-example)\n- [HTML formatting](#html-formatting)\n- [Markdown formatting](#markdown-formatting)\n- [Attachments](#attachments)\n- [Inline Image Attachments](#inline-image-attachments)\n- [Contributing](#contributing)\n- [Acknowledgements](#acknowledgements)\n\n## Quickstart\n```console\n$ pipx install mailmerge\n$ pipx ensurepath\n$ mailmerge\n```\n\n`mailmerge` will guide you through the process.  Don't worry, it won't send real emails by default.\n\n## Install\nSystem-wide install.\n```console\n$ pipx install mailmerge\n$ pipx ensurepath\n```\n\nFedora package install.\n```console\n$ sudo dnf install python3-mailmerge\n```\n\n## Example\nThis example will walk you through the steps for creating a template email, database and STMP server configuration.  Then, it will show how to test it before sending real emails.\n\n### Create a sample template email, database, and config\n```console\n$ mailmerge --sample\nCreated sample template email \"mailmerge_template.txt\"\nCreated sample database \"mailmerge_database.csv\"\nCreated sample config file \"mailmerge_server.conf\"\n\nEdit these files, then run mailmerge again.\n```\n\n### Edit the SMTP server config `mailmerge_server.conf`\nThe defaults are set up for GMail.  Be sure to change your username.  If you use 2-factor authentication, create an [app password](https://support.google.com/accounts/answer/185833?hl=en) first.  Other configuration examples are in the comments of `mailmerge_server.conf`.\n\n**Pro-tip:** SSH or VPN into your network first.  Running mailmerge from the same network as the SMTP server can help you avoid spam filters and server throttling.  This tip doesn't apply to Gmail.\n```\n[smtp_server]\nhost = smtp.gmail.com\nport = 465\nsecurity = SSL/TLS\nusername = YOUR_USERNAME_HERE\n```\n\n### Edit the template email message `mailmerge_template.txt`\nThe `TO`, `SUBJECT`, and `FROM` fields are required.  The remainder is the body of the message.  Use `{{ }}` to indicate customized parameters that will be read from the database.  For example, `{{email}}` will be filled in from the `email` column of `mailmerge_database.csv`.\n```\nTO: {{email}}\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\n\nHi, {{name}},\n\nYour number is {{number}}.\n```\n\n### Edit the database `mailmerge_database.csv`\nNotice that the first line is a header that matches the parameters in the template example, for example, `{{email}}`.\n\n**Pro-tip**: Add yourself as the first recipient.  This is helpful for testing.\n```\nemail,name,number\nmyself@mydomain.com,\"Myself\",17\nbob@bobdomain.com,\"Bob\",42\n```\n\n### Dry run\nFirst, dry run one email message (`mailmerge` defaults).  This will fill in the template fields of the first email message and print it to the terminal.\n```console\n$ mailmerge\n>>> message 1\nTO: myself@mydomain.com\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=\"us-ascii\"\nContent-Transfer-Encoding: 7bit\nDate: Thu, 19 Dec 2019 19:49:11 -0000\n\nHi, Myself,\n\nYour number is 17.\n>>> sent message 1\n>>> Limit was 1 message.  To remove the limit, use the --no-limit option.\n>>> This was a dry run.  To send messages, use the --no-dry-run option.\n```\n\nIf this looks correct, try a second dry run, this time with all recipients using the `--no-limit` option.\n```console\n$ mailmerge --no-limit\n>>> message 1\nTO: myself@mydomain.com\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=\"us-ascii\"\nContent-Transfer-Encoding: 7bit\nDate: Thu, 19 Dec 2019 19:49:33 -0000\n\nHi, Myself,\n\nYour number is 17.\n>>> sent message 1\n>>> message 2\nTO: bob@bobdomain.com\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=\"us-ascii\"\nContent-Transfer-Encoding: 7bit\nDate: Thu, 19 Dec 2019 19:49:33 -0000\n\nHi, Bob,\n\nYour number is 42.\n>>> sent message 2\n>>> This was a dry run.  To send messages, use the --no-dry-run option.\n```\n\n### Send first email\nWe're being extra careful in this example to avoid sending spam, so next we'll send *only one real email* (`mailmerge` default).  Recall that you added yourself as the first email recipient.\n```console\n$ mailmerge --no-dry-run\n>>> message 1\nTO: myself@mydomain.com\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=\"us-ascii\"\nContent-Transfer-Encoding: 7bit\nDate: Thu, 19 Dec 2019 19:50:24 -0000\n\nHi, Myself,\n\nYour number is 17.\n>>> sent message 1\n>>> Limit was 1 message.  To remove the limit, use the --no-limit option.\n```\n\nYou may have to type your email password when prompted. (If you use GMail with 2-factor authentication, don't forget to use the [app password](https://support.google.com/accounts/answer/185833?hl=en) you created while [setting up the SMTP server config](#edit-the-smtp-server-config-mailmerge_serverconf).)\n\nNow, check your email and make sure the message went through.  If everything looks OK, then it's time to send all the messages.\n\n### Send all emails\n```console\n$ mailmerge --no-dry-run --no-limit\n>>> message 1\nTO: myself@mydomain.com\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=\"us-ascii\"\nContent-Transfer-Encoding: 7bit\nDate: Thu, 19 Dec 2019 19:51:01 -0000\n\nHi, Myself,\n\nYour number is 17.\n>>> sent message 1\n>>> message 2\nTO: bob@bobdomain.com\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=\"us-ascii\"\nContent-Transfer-Encoding: 7bit\nDate: Thu, 19 Dec 2019 19:51:01 -0000\n\nHi, Bob,\n\nYour number is 42.\n>>> sent message 2\n```\n\n## Advanced template example\nThis example will send progress reports to students.  The template uses more of the advanced features of the [jinja2 template engine documentation](http://jinja.pocoo.org/docs/latest/templates/) to customize messages to students.\n\n#### Template `mailmerge_template.txt`\n```\nTO: {{email}}\nSUBJECT: EECS 280 Mid-semester Progress Report\nFROM: My Self <myself@mydomain.com>\nREPLY-TO: My Reply Self <myreplyself@mydomain.com>\n\nDear {{name}},\n\nThis email contains our record of your grades EECS 280, as well as an estimated letter grade.\n\nProject 1: {{p1}}\nProject 2: {{p2}}\nProject 3: {{p3}}\nMidterm exam: {{midterm}}\n\nAt this time, your estimated letter grade is {{grade}}.\n\n{% if grade == \"C-\" -%}\nI am concerned that if the current trend in your scores continues, you will be on the border of the pass/fail line.\n\nI have a few suggestions for the rest of the semester.  First, it is absolutely imperative that you turn in all assignments.  Attend lecture and discussion sections.  Get started early on the programming assignments and ask for help.  Finally, plan a strategy to help you prepare well for the final exam.\n\nThe good news is that we have completed about half of the course grade, so there is an opportunity to fix this problem.  The other professors and I are happy to discuss strategies together during office hours.\n{% elif grade in [\"D+\", \"D\", \"D-\", \"E\", \"F\"] -%}\nI am writing because I am concerned about your grade in EECS 280.  My concern is that if the current trend in your scores continues, you will not pass the course.\n\nIf you plan to continue in the course, I urge you to see your instructor in office hours to discuss a plan for the remainder of the semester.  Otherwise, if you plan to drop the course, please see your academic advisor.\n{% endif -%}\n```\n\n#### Database `mailmerge_database.csv`\nAgain, we'll use the best practice of making yourself the first recipient, which is helpful for testing.\n```\nemail,name,p1,p2,p3,midterm,grade\nmyself@mydomain.com,\"My Self\",100,100,100,100,A+\nborderline@fixme.com,\"Borderline Name\",50,50,50,50,C-\nfailing@fixme.com,\"Failing Name\",0,0,0,0,F\n```\n\n## HTML formatting\nMailmerge supports HTML formatting.\n\n### HTML only\nThis example will use HTML to format an email.  Add `Content-Type: text/html` just under the email headers, then begin your message with `<html>`.\n\n#### Template `mailmerge_template.txt`\n```\nTO: {{email}}\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nContent-Type: text/html\n\n<html>\n<body>\n\n<p>Hi, {{name}},</p>\n\n<p>Your number is {{number}}.</p>\n\n<p>Sent by <a href=\"https://github.com/awdeorio/mailmerge\">mailmerge</a></p>\n\n</body>\n</html>\n```\n\n\n### HTML and plain text\nThis example shows how to provide both HTML and plain text versions in the same message.  A user's mail reader can select either one.\n\n#### Template `mailmerge_template.txt`\n```\nTO: {{email}}\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nMIME-Version: 1.0\nContent-Type: multipart/alternative; boundary=\"boundary\"\n\nThis is a MIME-encoded message. If you are seeing this, your mail\nreader is old.\n\n--boundary\nContent-Type: text/plain; charset=us-ascii\n\nHi, {{name}},\n\nYour number is {{number}}.\n\nSent by mailmerge https://github.com/awdeorio/mailmerge\n\n--boundary\nContent-Type: text/html; charset=us-ascii\n\n<html>\n<body>\n\n<p>Hi, {{name}},</p>\n\n<p>Your number is {{number}}.</p>\n\n<p>Sent by <a href=\"https://github.com/awdeorio/mailmerge\">mailmerge</a></p>\n\n</body>\n</html>\n```\n\n\n## Markdown formatting\nMailmerge supports [Markdown](https://daringfireball.net/projects/markdown/syntax) formatting by including the custom custom header `Content-Type: text/markdown` in the message. Mailmerge will render the markdown to HTML, then include both HTML and plain text versions in a multiplart message. A recipient's mail reader can then select either format.\n\n### Template `mailmerge_template.txt`\n```\nTO: {{email}}\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nCONTENT-TYPE: text/markdown\n\nYou can add:\n\n- Emphasis, aka italics, with *asterisks*.\n- Strong emphasis, aka bold, with **asterisks**.\n- Combined emphasis with **asterisks and _underscores_**.\n- Unordered lists like this one.\n- Ordered lists with numbers:\n    1. Item 1\n    2. Item 2\n- Preformatted text with `backticks`.\n- How about some [hyperlinks](http://bit.ly/eecs485-wn19-p6)?\n\n# This is a heading.\n## And another heading.\n\nHere's an image not attached with the email:\n![python logo not attached](http://pluspng.com/img-png/python-logo-png-open-2000.png)\n```\n\n## Attachments\nThis example shows how to add attachments with a special `ATTACHMENT` header.\n\n#### Template `mailmerge_template.txt`\n```\nTO: {{email}}\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nATTACHMENT: file1.docx\nATTACHMENT: ../file2.pdf\nATTACHMENT: /z/shared/{{name}}_submission.txt\n\nHi, {{name}},\n\nThis email contains three attachments.\nPro-tip: Use Jinja to customize the attachments based on your database!\n```\n\nDry run to verify attachment files exist. If an attachment filename includes a template, it's a good idea to dry run with the `--no-limit` flag.\n```console\n$ mailmerge\n>>> message 1\nTO: myself@mydomain.com\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\n\nHi, Myself,\n\nThis email contains three attachments.\nPro-tip: Use Jinja to customize the attachments based on your database!\n\n>>> attached /Users/awdeorio/Documents/test/file1.docx\n>>> attached /Users/awdeorio/Documents/file2.pdf\n>>> attached /z/shared/Myself_submission.txt\n>>> sent message 1\n>>> This was a dry run.  To send messages, use the --no-dry-run option.\n```\n\n## Inline Image Attachments\n\nThis example shows how to add inline-image-attachments so that the images are rendered directly in the email body. You **must** add the inline-image as an attachment before referencing it in the body.\n\n#### HTML Example: Template `mailmerge_template.txt`\n\n```\nTO: {{email}}\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nContent-Type: text/html\nATTACHMENT: image.jpg\nATTACHMENT: second/image.jpg\n\n<html>\n<body>\n\n<p>Hi, {{name}},</p>\n\n<img alt=\"Sample image\" src=\"image.jpg\" />\n\nThe second image: <img alt=\"second\" src=\"second/image.jpg\">\n\n<p>Sent by <a href=\"https://github.com/awdeorio/mailmerge\">mailmerge</a></p>\n\n</body>\n</html>\n```\n\n#### Markdown Example: Template `mailmerge_template.txt`\n```\nTO: {{email}}\nSUBJECT: Testing mailmerge\nFROM: My Self <myself@mydomain.com>\nATTACHMENT: image.jpg\nCONTENT-TYPE: text/markdown\n\nHi, {{name}},\n\n![image alt-description](image.jpg)\n```\n\n## Contributing\nContributions from the community are welcome! Check out the [guide for contributing](CONTRIBUTING.md).\n\n\n## Acknowledgements\nMailmerge is written by Andrew DeOrio <awdeorio@umich.edu>, [http://andrewdeorio.com](http://andrewdeorio.com).  Sesh Sadasivam (@seshrs) contributed many features and bug fixes.\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2016 Andrew DeOrio  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. ",
    "summary": "A simple, command line mail merge tool",
    "version": "2.2.4",
    "project_urls": {
        "homepage": "https://github.com/awdeorio/mailmerge/"
    },
    "split_keywords": [
        "mail merge",
        " mailmerge",
        " email"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aa880432046bea15a1d875295c470c25632c4146c6503c38e63e86566ef80193",
                "md5": "db83d619f475284eb5de75c13cacf6de",
                "sha256": "cc590ac7d736d8f16d89f8e3566485870bf9d8e0d1c05a68bb12684b63295562"
            },
            "downloads": -1,
            "filename": "mailmerge-2.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "db83d619f475284eb5de75c13cacf6de",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 17649,
            "upload_time": "2024-10-31T19:38:40",
            "upload_time_iso_8601": "2024-10-31T19:38:40.177921Z",
            "url": "https://files.pythonhosted.org/packages/aa/88/0432046bea15a1d875295c470c25632c4146c6503c38e63e86566ef80193/mailmerge-2.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "76a21273e0d55445dab0cb7ed29813d1daf56218017940f932dd87a1ba28e7dd",
                "md5": "e24f679b3432f51f768fb3b6e692cd90",
                "sha256": "188061e778a8e3c08bffcd9b22996a40f27f7775c580fdf7b5be33013bb7b58a"
            },
            "downloads": -1,
            "filename": "mailmerge-2.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "e24f679b3432f51f768fb3b6e692cd90",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 41625,
            "upload_time": "2024-10-31T19:38:41",
            "upload_time_iso_8601": "2024-10-31T19:38:41.849660Z",
            "url": "https://files.pythonhosted.org/packages/76/a2/1273e0d55445dab0cb7ed29813d1daf56218017940f932dd87a1ba28e7dd/mailmerge-2.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-31 19:38:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "awdeorio",
    "github_project": "mailmerge",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "mailmerge"
}
        
Elapsed time: 4.65955s