Giter VIP home page Giter VIP logo

mail-slinger's Introduction

Mail Slinger

While plenty solutions exist to distribute mass emails to a set of email addresses, filling in custom information for each message (mail merge), few, if any, solutions exist to CC a user on all of those emails, especially when paired with a custom SMTP Host (not gmail). While this may seem like an unusual use case, it does have some practical applications, especially in the age of meeting scheduling services, like x.ai, which operate via email and being notified via being CCd on an email.

This relatively simple Java program does just that, taking in a CSV file with the recipient list and merge attributes, and an .eml file containing the email message you would like to send. Running it is as easy as executing the jar file (which you will need to build once you have entered your desired values in the config.properties file) via the JVM and the line below:

java -jar build/libs/mail-slinger-1.0.jar template.eml emails.csv

The arguments can be provided in any order, with the argument type being determined via the file extension; either .eml for the template or .csv for the recipient list.

Making the Message Template

Most email clients will let you compose a draft, save that draft, and then let you save it as an .eml file from there; dragging and dropping the message to your desktop often will have the same affect. The message can have individual content injected via jTwig tags, the most common of which in this application will be the double curly braces, which surround the attribute name; for example: {{first_name}}. By default, the fields first_name, last_name, and name are included based off of the required fields in the recipient list, however additional attributes can be added by including more columns in the recipient list, with the header column value becoming the attribute name.

Recipient List

The recipient list is provided in the form of a CSV file, which must include a header row, which is used to identify the contents of each column. For the most part columns can have an arbitrary heading, although the following three headers are required:

  • first_name
  • last_name
  • address

Configuration

A sample properties file is located in src/main/resources/sample_config.properties which can be duplicated and renamed to config.properties also in the resources folder. From there, you can modify the SMTP host, port (make sure you set both values correctly, they will usually be the same), and who should be CCed on all of the messages.

Once this is done, you can build the .jar file using the included Gradle Wrapper via the line below. You may need to make the Gradle wrapper executable, if you encounter permission issues.

./gradlew clean build fatJar

Gradle will save the resulting .jar file in build/libs from where it can either be executed or saved elsewhere for future execution.

mail-slinger's People

Contributors

tpaulus avatar

Watchers

 avatar  avatar  avatar

mail-slinger's Issues

Gradle issues

Had a few pain points with Gradle
1: didn't have a gradle-wrapper.jar file in the right directory. Fixed that by running gradle init and copying the gradle-wrapper.jar file it made into mail-slinger-master/gradle/wrapper
2: currently getting an error that seems to be related to version compatibility?

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.

I'm running java 9.0.4 and Gradle 4.6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.