Get answers quicker by searching

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Send Mails form PHP code with no API call
  • Vote Up0Vote Down mrepergermreperger
    Posts: 5Sendy user

    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?

  • 1 Comment
  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support

    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.
All Discussions