Skip to content

Send Mails form PHP code with no API call

edited May 2013 in Questions

I understand there is no native way to create an email from a PHP code and send it. What if I add to the db the mail I want to send and I set the send_date 'NOW()'? That will do to send the email from my code the next time the schedule con runs, right?

Comments

  • Hi Marcelo,

    Here're the columns in campaigns table where data needs to be inserted in order to send a campaign via cron without using Sendy's interface:

    • userID: Your userID (usually 1)
    • app: The brand's ID, in 'apps' table
    • from_name: Your 'From name'
    • from_email: Your 'From email address'
    • reply_to: Your 'Reply to email address'
    • title: Subject line of your newsletter
    • plain_text: Plain text of your newsletter
    • html_text: HTML of your newsletter
    • sent: The current time in unix timestamp (eg. 1368684214)
    • to_send: The total number of subscribers in the combination of list(s) you want to send to (you'll need to write a script to count the number of subscribers in 'subscribers' table that matches the list ids of the combination of lists you want to send to)
    • send_date: 0
    • lists: list IDs separated by comma, (eg. 2,14,25)
    • timezone: 0

    Thanks.

    Ben

This discussion has been closed.