Email Parser

Extract data from incoming emails and automate your workflow

MENUMENU

Complete newsletter system with subscription handling and email delivery

This example shows how you can use Email Parser to handle a newsletter subscription system driven by a MySQL database. Using databases such as Microsoft SQL or any ODBC-compatible database is also possible because in this example we use standard SQL queries.

The workflow is the following:

  • The incoming emails are separated in four types: subscription status requests, subscriptions adding requests, subscription removal requests and emails from the newsletter administrator.
  • The subscription status requests are handled checking in the database if the sender email address exists. Depending on the result of the SQL SELECT operation a “you are subscribed” or a “you are not subscribed” reply email is sent.
  • Subscription adding requests are handled running a SQL INSERT command and sending a confirmation email.
  • Subscription removel requests are handled running a  SQL DELETE command and sending a confirmation email.
  • Emails from the newsletter admin are resent to all the subscribers. This is done getting all the email addresses from the database and sending an email for each one.

 

 

example_26_leftpanel
Download this example

 

 

 

  • Check wether or not an user is subscribed.example_26_1_partWhen someone sends an email to example@example.com and writes in the email body “subscription status” (the body can contain any text) Email Parser checks in the database if the user is subscribed or not. It reply with an email depending on the subscription status.
  • Subscribe to the newsletterexample_26_2_partWhen someone sends an email to example@example.com and writes in the email body “subscribe me” Email Parser inserts in the database the email address of the sender and send a confirmation message
  • Unsubscribe from the newsletterexample_26_3_partWhen someone sends an email to example@example.com and writes in the email body “remove my subscription” Email Parser deletes the email address of the sender from the database.
  • Email delivery to all the subscribed email addressesexample_26_4_partThe newsletter delivery to all subscriber email addresses can be done only from the specific email adddress “admin@example.com”. Any email received from that address will be forwarded to all the email addresses in the database.