Saturday, 11 May 2013

Create Your Own Maillist Manager using the Xataface Email Module


Suppose you have a "contacts" table in your database that contains contact information of all of your customers or users.  It is probable that you intend to contact these by email - e.g. for a mailing list.  The Xataface Email module makes it a simple matter to use this table as a mailing list.

What it Does

The Email module adds a "Send Email" action to all designated tables that allows you to send email to all records in the current found set.

Features

  • HTML Email
  • Attachments
  • Email templates
  • Compatible with all existing found sets.  (E.g. you can perform a search for any subset of rows, and the module will send to the found set).

Prerequisites

Installation

  1. Create a modules directory inside your application's directory, if it doesn't exist already:

    $ cd /path/to/my/app
    $ mkdir modules
  2. Check out the latest SVN trunk of the ckeditor module into the modules directory:

    $ cd modules
    $ svn co http://weblite.ca/svn/dataface/modules/ckeditor/trunk ckeditor
  3. Check out the latest SVN trunk of the Email module into the modules directory

    $ svn co http://weblite.ca/svn/dataface/modules/Email/trunk Email
  4. Activate both the ckeditor and Email modules in the conf.ini file by adding the following to the [_modules] section:

    modules_ckeditor=modules/ckeditor/ckeditor.php
    modules_Email=modules/Email/Email.php
  5. Designate the tables on which you want the "Send Email" action to be available by marking them as implementing the Person ontology.  You do this by adding the following to the beginning of the fields.ini file of each table that should be designated:

    [__implements__]
        Person=1
  6. In addition, you may need to specify which field of the table contains the email address.  You do this by adding the email=1 directive to the field's definition in the fields.ini file.  E.g:

    [my_email_field]
        email=1


    If you don't do this, Xataface will have to try and guess which field to use - and it may be wrong!

Enabling Attachments

If you want to be able to send attachments with your email messages,  you will need to follow these additional installation steps:
  1. Install the ajax_upload module.  You can do this by navigating to the modules directory, and checking out the latest from SVN:

    $ cd modules
    $ svn co http://weblite.ca/svn/dataface/modules/ajax_upload/trunk ajax_upload
  2. Enable the ajax_upload module in your conf.ini file by adding the following to the [_modules] section:

    modules_ajax_upload=modules/ajax_upload/ajax_upload.php
  3. Specify the location of the directory to store the uploaded files, by adding the following to your conf.ini file:

    [modules_Email]
        attachments=path/to/attachments
        attachments_url=url/to/attachments

Sending Email

Now that we have the module installed, let's try to send some email.  In our example application, I have a "contacts" table with all of my contacts.
The "List" view for the contacts table.  Notice the "Send Email" button, which is present because the Email module is installed and the contacts table is designated as a "Person" entity.

You can see from the result descriptor in the upper right that the current found set has 1155 records.  If you want to send an email to all 1155 contacts, just click the "Send Email" button at the top.  This will open the email form:
The email form.  The Message body uses CKeditor to allow you to craft an HTML email in WYSIWYG fashion.


Before proceeding with sending the email, you should double check that you are sending to the found set that you intend.  Look at the description at the top of the form that says "Please complete the form below to send email to the 1155 email addresses...", and ensure that the number looks right.  You should also click the "Show Email Addresses" link to reveal a list of the email addresses that will be mailed.  The worst thing you can do is accidentally send an email to thousands of people.
If you accidentally click "Send", you can still cancel or pause the email queue at any time - so there are some fail safes in place.

So let's send a simple email to all of our found set:
A simple email by filling in the subject, from, and message body fields.  Notice that the "From" field should include the email address in the standard email notation: Name <address>.
Now that we're ready, click the "Send Now" button:
This will show an email progress form to allow you to track the progress of the mailout:

You can cancel/pause the mailout at any time by clicking the "Cancel" button.  Clicking this button will take you to a "Job Paused" screen:
You can resume the job by clicking "Resume Job", and you can also view the mail log to see a detailed log of all of the email that has already been sent (by clicking "View Mail Log"):
The email history log shows every email that has been sent, along with status information about the Email.


In my example email here, it sent out 96 emails successfully before I paused it.  Logging into my email program, I can view the email:
The resulting email as opened in my Email reader

Opting Out of the Mail List

Notice that the mailer automatically added a line at the bottom of the email to give the recipient the option to "Opt out" of the mailing list.  This "opt-out" feature is built into the Email module and is handled automatically for you.  The module keeps a "black list" of email addresses that should not receive email.  When a batch email is created, it automatically skips any recipient addresses on this black list (unless you explicitly tell the Email module to ignore the black list on the email form).

Just to see what happens, I'm going to click on the link to opt out:

Form to opt out of receiving email notifications

This form gives the user an opportunity to reconsider opting out.  If they are sure that they don't want to receive email from this list, they can click the button on this form.  

They can opt back in at any time by clicking the same link that is in the email.

Customizing the Opt-Out Instructions

In some cases you might not want the user to see this opt-out message, or you may want to customize it to fit your purposes.  This can be done using either a conf.ini  file directive or a delegate class method.  For this example, let's just use the conf.ini file directives.  You can simply add the following section, and sub-directives to your conf.ini file:

opt_out_html = "<hr/><p>Click <a href='$url'>here</a> to opt out of our list.</p>"
opt_out_text = "\r\n\r\n----------------------\r\n To opt out, go to $url \r\n"

You can specify any text you want here.  Just embed the $url variable in the content where you want the link to the opt-out page to appear.

20 comments:

  1. Great post,thanks for sharing this useful information.In recent era, for the advertising and marketing of any new or old business there is one effective and low costly way used that is email marketing. Purchasing email lists or buying them from email lists for sale will be very beneficial for your business. This will increase the revenue and reputation of your company in market.

    ReplyDelete
    Replies
    1. Hi everyone I'm Olivia Hannah and am here to share the wonderful work Dr Raypower did for me. After 5 years in marriage with my husband with 2 kids, my husband started acting weird and going out with other ladies and showed me cold love, on several occasions he threatens to divorce me if I dare question him about his affair with other ladies, I was totally devastated and confused until a old friend of mine told me about a spell caster on the internet called Dr. Raypower who help people with relationship and marriage problem by the powers of love spells, at first I doubted if such thing ever exists but decided to give it a try, when I contact him, he helped me cast a love spell and within 48hours my husband came back to me and started apologizing, now he has stopped going out with other ladies and his with me for good and for real. Contact this great love spell caster for your relationship or marriage problem to be solved today via email: Urgentspellcast@gmail.com or Urgentspellcast@yahoo.com or Call or WhatsApp: +14243308109. 

      Read more about him on his website: http://urgentspellcast.website2.me/

















      Hi everyone I'm Olivia Hannah and am here to share the wonderful work Dr Raypower did for me. After 5 years in marriage with my husband with 2 kids, my husband started acting weird and going out with other ladies and showed me cold love, on several occasions he threatens to divorce me if I dare question him about his affair with other ladies, I was totally devastated and confused until a old friend of mine told me about a spell caster on the internet called Dr. Raypower who help people with relationship and marriage problem by the powers of love spells, at first I doubted if such thing ever exists but decided to give it a try, when I contact him, he helped me cast a love spell and within 48hours my husband came back to me and started apologizing, now he has stopped going out with other ladies and his with me for good and for real. Contact this great love spell caster for your relationship or marriage problem to be solved today via email: Urgentspellcast@gmail.com or Urgentspellcast@yahoo.com or Call or WhatsApp: +14243308109. 

      Read more about him on his website: http://urgentspellcast.website2.me/

      Delete
    2. I want to let everyone here know that Spell casting really works. However it wouldn't have been possible for me to get my ex back without the kind support and help of Dr Larry, whose his Website: http://assurancesolutioncenter.website2.me/ i would like to extend my golden sincere thanks to Dr Larry who helped me to get my ex back. i want to thank  this great spell caster who is so powerful and good in spell casting. I am highly indebted to Dr Larry for his help in getting my ex back. My boyfriend left me for another girl, i was so heart broken so i contacted a friend who introduced me to the great Dr Larry who have helped her before to get her boyfriend back so i did all he asked me to do. Surprisingly 48 hours later as he promised my boyfriend called me and asked me to forgive him, we are back together living happily. Don't let anybody to deceive you spell casting works. Contact him through his website: http://assurancesolutioncenter.website2.me/ and Email: assurancesolutionhome@gmail.com. Whatsapp +1(424)-261-8520 thank you so much sir   http://assurancesolutioncenter.over-blog.com  







      I want to let everyone here know that Spell casting really works. However it wouldn't have been possible for me to get my ex back without the kind support and help of Dr Larry, whose his Website: http://assurancesolutioncenter.website2.me/ i would like to extend my golden sincere thanks to Dr Larry who helped me to get my ex back. i want to thank  this great spell caster who is so powerful and good in spell casting. I am highly indebted to Dr Larry for his help in getting my ex back. My boyfriend left me for another girl, i was so heart broken so i contacted a friend who introduced me to the great Dr Larry who have helped her before to get her boyfriend back so i did all he asked me to do. Surprisingly 48 hours later as he promised my boyfriend called me and asked me to forgive him, we are back together living happily. Don't let anybody to deceive you spell casting works. Contact him through his website: http://assurancesolutioncenter.website2.me/ and Email: assurancesolutionhome@gmail.com. Whatsapp +1(424)-261-8520 thank you so much sir   http://assurancesolutioncenter.over-blog.com  

      Delete
  2. I saw this post. It is full of information. This post was very nice to me. I hope everyone will be better. Thanks for sharing.

    email lists for sale

    ReplyDelete
  3. TeethNightGuard is selling precise fitting and high quality custom made teeth guards.

    ReplyDelete
  4. When you have aggregated an email rundown and remember this can comprise of thousands or possibly simply several dozen, you can begin promoting yourself productively. email on deck

    ReplyDelete
  5. Quantum Binary Signals

    Get professional trading signals sent to your mobile phone every day.

    Start following our signals NOW & profit up to 270% per day.

    ReplyDelete
  6. I wanted to say that I have loved this blog.Very informative post with lots of information included in the posting.
    You have made some really good points here ! You might also be interested to know more about generating more leads and getting the right intelligence to engage prospects.E-Health Care Lists implements new lead gen ideas and strategies for generating more leads and targeting the right leads and accounts.E-Health Care Lists is one of the global suppliers of healthcare mailing list & email list.Marketing to the healthcare industry, reaching the doctors and other healthcare decision makers is often an impossibletask.Please refer to
    Purchasing Director Mailing list & Email list

    ReplyDelete
  7. If you need your ex-girlfriend or ex-boyfriend to come crawling back to you on their knees (even if they're dating somebody else now) you need to watch this video
    right away...

    (VIDEO) Want your ex CRAWLING back to you...?

    ReplyDelete
  8. Hello i am here to spread this good news to the entire world on how i got my ex love back.I was going crazy when my love left me for another girl last month,But when i meet a friend that introduce me to DR IROSI the great messenger to the oracle that he serve,I narrated my problem to DR IROSI about how my ex love left me and also how i needed to get a job in a very big company.He only said to me that i have come to the right place were i will be getting my heart desire without any side effect.He told me what i need to do,After it was been done,In the next 2 days,My love called me on the phone and was saying sorry for living me before now and also in the next one week after my love called me to be pleading for forgiveness,I was called for interview in my desired company were i needed to work as the managing director..I am so happy and overwhelmed that i have to tell this to the entire world to contact DR IROSI at the following email address DRIROSISOLUTIONCENTER@GMAIL.COM and get all your problem solve..No problem is too big for him to solve..Contact him direct on DRIROSISOLUTIONCENTER@GMAIL.COM or call his mobile number or add him up on whatsapp via (+2348118829771). and get your problems solve like me.    

    ReplyDelete
  9. LOVE SPELLS THAT WORKS I am sharing this testimony to partners suffering in their relationships because there is an enduring solution.
    My husband left me and our 2 kids for another woman for 3 years. I tried to be strong just for my kids but I could not control the pains that torment my heart. I was hurt and confused. I needed a help, so i did a research on the internet and came across a site where I saw that Dr. Aluya a spell caster, can help get lovers back. I contacted him and he did a special prayer and spells for me. To my surprises, after some days, my husband came back home. That was how we reunited again and there was a lot of love, joy and peace in the family.
    You can as well contact Dr.  Aluya  , a powerful spell-caster for solutions on his contact aluya.48hoursspelltemple@gmail.com or directly on Whats App: +2348055431163 

    ReplyDelete
  10. I want to let everyone here know that Spell casting really works. However it wouldn't have been possible for me to get my ex back without the kind support and help of Dr Larry, whose his Website: http://assurancesolutioncenter.website2.me/ i would like to extend my golden sincere thanks to Dr Larry who helped me to get my ex back. i want to thank  this great spell caster who is so powerful and good in spell casting. I am highly indebted to Dr Larry for his help in getting my ex back. My boyfriend left me for another girl, i was so heart broken so i contacted a friend who introduced me to the great Dr Larry who have helped her before to get her boyfriend back so i did all he asked me to do. Surprisingly 48 hours later as he promised my boyfriend called me and asked me to forgive him, we are back together living happily. Don't let anybody to deceive you spell casting works. Contact him through his website: http://assurancesolutioncenter.website2.me/ and Email: assurancesolutionhome@gmail.com. Whatsapp +1(424)-261-8520 thank you so much sir   http://assurancesolutioncenter.over-blog.com  







    I want to let everyone here know that Spell casting really works. However it wouldn't have been possible for me to get my ex back without the kind support and help of Dr Larry, whose his Website: http://assurancesolutioncenter.website2.me/ i would like to extend my golden sincere thanks to Dr Larry who helped me to get my ex back. i want to thank  this great spell caster who is so powerful and good in spell casting. I am highly indebted to Dr Larry for his help in getting my ex back. My boyfriend left me for another girl, i was so heart broken so i contacted a friend who introduced me to the great Dr Larry who have helped her before to get her boyfriend back so i did all he asked me to do. Surprisingly 48 hours later as he promised my boyfriend called me and asked me to forgive him, we are back together living happily. Don't let anybody to deceive you spell casting works. Contact him through his website: http://assurancesolutioncenter.website2.me/ and Email: assurancesolutionhome@gmail.com. Whatsapp +1(424)-261-8520 thank you so much sir   http://assurancesolutioncenter.over-blog.com  

    ReplyDelete
  11. Hi viewers online, I'm Alfonso Vázquez from Mexico. I'm here to share my testimony about how i was helped to get my wife back. I was a cheat and my wife caught me several times. I tried fixing myself and each time i ended up cheating over and over again. I guess i didn't realise what she meant to me until she had left me alone. I began to find a way to get her back but nothing seems to work out perfectly till i came across an article about Lord Zakuza who helped a lot of people globally to get their relationships back. I made contact with him and he assured me that my wife will come back to me within 48 hours with his powerful magics and i paid 410 Euros for the materials needed for the work. Surprisingly, my wife came back home after 2 days saying that she still loves me and i swore never to cheat on her anymore. All thanks to Lord Zakuza. You can have a chat with him on his WhatsApp number via +1 740-573-9483.

    ReplyDelete
  12. I want to use this great opportunity to thank Dr Aluya for helping me to get my boyfriend back after 3 months of breakup. My boyfriend breakup with me because he see another girl at his working place and told me he is no longer interested in me and live me in pain and heart break. I seek for help on the internet and i saw so many good talk about this great spell caster Dr Aluya and I contacted him also and explain my problems to him and he cast a love spell for me which i use to get back my boyfriend within the period of 48 hours and i am so grateful to him for the good work he did for me,that is why i also want to let everyone who is in need of help out there to also seek help from him so he can help.His email is aluya.48hoursspelltemple@gmail.com or whatsapp: +2348110493039

    ReplyDelete
  13. Hi viewers online, I'm Alfonso Vázquez and I'm here to share my testimony about how i was helped to get my wife back. I was a cheat and my wife caught me several times. I tried fixing myself and each time i ended up cheating over and over again. I guess i didn't realise what she meant to me until she had left me alone. I began to find a way to get her back but nothing seems to work out perfectly till i came across an article about Lord Zakuza who helped a lot of people globally to get their relationships back. I made contact with him on his WhatsApp number via +1 740-573-9483 and he assured me that my wife will come back to me within 48 hours with his powerful magics and i paid 410 Euros for the materials needed for the work. Surprisingly, my wife came back home after 2 days saying that she still loves me and i swore never to cheat on her anymore. All thanks to Lord Zakuza. WhatsApp him via +1 740-573-9483 or Email him via: lordzakuza7@gmail.com

    ReplyDelete
  14. Hi everyone, my name is Rabueil Islam
     and am from London, I met this spell caster called Dr Aluya of aluya.48hoursspelltemple@gmail.com online and so many other, but i decided to go with this particular spell caster and this is about 2 weeks ago. I needed the spell caster to reunite me and my lover because she started behaving strange and a day came she text me and told me she cannot continue with the relationship anymore, that she just want to be alone. But a close friend of hers shows the guy to me that she was now dating. So i contacted this spell caster because i was totally heart broken and i smoked and get drunk till i could not even notice if am standing or lying.This spell caster told me not to worry, he gave me hope that am to have her again just like old times, and i provided all the requirements, and in just 5 days, my ex lover called me crying over the phone asking for me to forgive her for her stupid act, and she swore with her mother grave to love me and never hurt me again.This was what the spell caster earlier told me and it came after he has done the spell and that same night, my lover came to my house and spend the night with me.I have never seen spell as powerful as this but now, am convinced that Dr Aluya is the best ever, You can contact him through him email address:aluya.48hoursspelltemple@gmail.com or WhatsApp: +2348110493039

    ReplyDelete
  15. My lover dumped for  another woman with two kids i was confused until i came
    in contact with Dr Aluya who helped me with a powerful love spell that
    brought him back within 2 days. contact Dr Aluya for help on :
    Email :aluya.48hoursspelltemple@gmail.com or WhatsApp him  +2348110493039

    ReplyDelete
  16. Get Your Wife Back, Perfect Urgent Love Spell. Am Oliva Giphy
     from FL Usa All Thanks To Dr Aluya Who Brought Back The Love Of My Life. my girlfriend cheated on me and asked for a breakup. I don't believe at first i try to get back with her but all she told me was she’s with someone else. that she is no longer interested in marrying me at that point i was heart broken coz i love my girlfriend so much that i could not let go off her all of a sudden she left me, i really love her and never can imagine my life without her. not until i came across a powerful real spell caster Dr Aluya who promise me 48hours urgent love spell to get back with my girlfriend, good twenty-four {48} hours. hmm-mm, it was a good night time at 11:pm within the days that Dr Aluya told me that my girlfriend will be back, at first i heard the bell rings getting close to my door i heard someone saying honey!!!, it sound familiar i opened the door and i saw my girlfriend standing and weeping in front of me. i was not surprised because its all i have been praying for her to come back home. Guess what 2 weeks after she noticed her system and her body temperature was changed and i took her to clinic for check up and the doctor told me that there is life in her which means she was pregnant i really wants to use this opportunity to thanks Dr Aluya so much and the love page that directed me to Dr Aluya if you have any problem getting your ex back, or predicament that is worse or exactly like this you have been into, contact Dr Aluya on aluya.48hoursspelltemple@gmail.com Whatsapp/cal  +2348110493039  
    https://draluya48hoursspelltemple.webs.com/

    ReplyDelete
  17. My lover dumped another woman with two kids i was confused until i came
    in contact with Dr Aluya who helped me with a powerful love spell that
    brought him back within 2 days. contact Dr Aluya for help on :
    Email :aluya.48hoursspelltemple@gmail.com or aluya.48hoursspelltemple@yahoo.com WhatsApp him +2348110493039


    website https://draluya48hoursspelltemple.webs.com/

    ReplyDelete
  18. How I Got My Ex Husband Back..Am so excited to share my testimony of a real spell caster who brought my husband back to me. My husband and I have been married for about 6 years now. We were happily married with two kids, a boy and a girl. 3 months ago, I started to notice some strange behavior from him and a few weeks later I found out that my husband is seeing someone else. He started coming home late from work, he hardly care about me or the kids anymore, Sometimes he goes out and doesn't even come back home for about 2-3 days. I did all I could to rectify this problem but all to no avail. I became very worried and needed help. As I was browsing through the internet one day, I came across a website that suggested that Dr Aluya can help solve marital problems, restore broken relationships and so on. So, I felt I should give him a try. I contacted him and and told him my problems and he told me what to do and i did it and he did a spell for me. 48 hours later, my husband came to me and apologized for the wrongs he did and promise never to do it again. Ever since then, everything has returned back to normal. I and my family are living together happily again.. All thanks to Dr Aluya Powerful Love Spell that really works. If you have any problem contact him and i guarantee you that he will help you. He will not disappoint you. Email him at: {aluya.48hoursspelltemple@gmail.com}. or  {aluya.48hoursspelltemple@yahoo.com} whatsapp him on: +2348110493039  
      https://draluya48hoursspelltemple.webs.com/  

    ReplyDelete