Title: Using this plugin conditionally
Last modified: June 22, 2017

---

# Using this plugin conditionally

 *  [yosmc](https://wordpress.org/support/users/yosmc/)
 * (@yosmc)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/using-this-plugin-conditionally/)
 * Hello,
 * I need to implement more complicated conditions to determine if and when a newsletter
   should be sent – basically I have to make some database queries first to find
   out if the conditions are met. I’m trying to achieve this by launching my own
   script via crontab – the script will check the conditions, and only if they are
   met, trigger the newsletter-sending process.
 * Is this something I can (ab)use the Tribulant plugin for?
 * Probable needs:
    – For my purposes, I somehow need to trigger newsletters individually(
   from my script). Is there an URL or a specific function I can call to achieve
   that? – Although this seems like an old article – [https://tribulant.com/docs/tag/hooks/](https://tribulant.com/docs/tag/hooks/)–
   I guess those hooks still exist and can be used to alter the newsletter content
   from my script?
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Tribulant Software](https://wordpress.org/support/users/contrid/)
 * (@contrid)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/using-this-plugin-conditionally/#post-9267285)
 * [@yosmc](https://wordpress.org/support/users/yosmc/)
 * Yes, you can definitely do this with the Newsletter plugin.
 * Your script can run and do it’s thing and then you can use the functions/methods
   and hooks of the Newsletter plugin as you wish.
 * For example, you can send an email using the `execute_mail()` function inside`
   wp-mailinglist-plugin.php` file of the plugin. But it takes a subscriber object
   so you’ll first need to save a subscriber.
 * Will you digg into the code and see if you find what you’re looking for and let
   me know if you need any specific direction?

Viewing 1 replies (of 1 total)

The topic ‘Using this plugin conditionally’ is closed to new replies.

 * ![](https://ps.w.org/newsletters-lite/assets/icon-256x256.png?rev=1184265)
 * [Newsletters](https://wordpress.org/plugins/newsletters-lite/)
 * [Support Threads](https://wordpress.org/support/plugin/newsletters-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/newsletters-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/newsletters-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/newsletters-lite/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [newsletter plugin](https://wordpress.org/support/topic-tag/newsletter-plugin/)
 * [newsletters](https://wordpress.org/support/topic-tag/newsletters/)
 * [script](https://wordpress.org/support/topic-tag/script/)

 * 1 reply
 * 2 participants
 * Last reply from: [Tribulant Software](https://wordpress.org/support/users/contrid/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/using-this-plugin-conditionally/#post-9267285)
 * Status: not resolved