×

info

Dear guests,
You are currently on the old forum we kept as a knowledge base. You will find the new community forum here
Welcome, Guest
Username: Password: Remember me
Keyword

TOPIC: Sending newsletter on a new database entry.

Sending newsletter on a new database entry. 6 years 1 month ago #63672

  • Anonymous user
  • chetanmadaan's Avatar
  • Posts: 6
  • Karma: 0
Hi -

i know Acymailing Enterprise has this feature where a newsletter can be triggered whenever a new article is added or a new k2 item or other popular extension definitions.

We are trying to do something similar but it's in our own database table and not one of the popular extensions.

My question is that?? will it still be possible? if so, how?
Please log in to post a reply

Re: Sending newsletter on a new database entry. 6 years 1 month ago #63675

  • Anonymous user
  • Adrien's Avatar
  • Posts: 20233
  • Karma: 680
Hello,

All our system is done using plugins.
So when you want to develop this functionality for another Joomla extension, the only thing we do is a new plugin!

The same way, you could develop your own plugin for AcyMailing:
www.acyba.com/en/support/documentation/6...cumentation.html#tag
Please have a look at our official documentation before posting a new message!

Do you like AcyMailing? We love your reviews!
We would appreciate if you could take 5 minutes to post a review on the Joomla! Extensions Directory.
We answered one of your question? Well, it's the best way to thank us!
Please log in to post a reply

Re: Sending newsletter on a new database entry. 6 years 1 month ago #63714

  • Anonymous user
  • chetanmadaan's Avatar
  • Posts: 6
  • Karma: 0
Hi -

i had a look at the example plugin and the code there... but there wasn't and example to trigger a newsletter send or something like that?

i mean there was once to send an email to a specefic user... but nothing to actually execute a newsletter to a specefic list via CURL or something like that.

I wonder if it's even possible without hacking the code.
Please log in to post a reply

Re: Sending newsletter on a new database entry. 6 years 1 month ago #63717

  • Dax
  • Dax's Avatar
  • Posts: 6423
  • Karma: 227
Hello,

The function "acymailing_replacetags(&$email,$send = true)" is called automatically by AcyMailing if your plugin is enabled when the newsletter is sent, so it is in this function where you can replace your tags, for example :
function acymailing_replacetags(&$email,$send = true)
{
	$db = JFactory::getDBO();
	$db->setQuery('SELECT what_you_want FROM #__your_table');
	$allContent = $db->loadObjectList();
	$replace = '';
	foreach($allContent as $content)
	{
		$replace .= 'Some text : '.$content->one_field.'<br/>Other text : '.$content->other_field;
	}

	$email->body = str_replace('{tagexample}',$replace,$email->body);
	$email->altbody = str_replace('{tagexample}','my string',$email->altbody);
	$email->subject = str_replace('{tagexample}','my string',$email->subject);
}

Regards,
Jeremy
-AcyMailing developer-
This email address is being protected from spambots. You need JavaScript enabled to view it.

I helped you? The best way to thank me is to post a review on the JED :laugh:

Do not hesitate to illustrate your messages with screenshots, I love images :)
Always consult our tutorials before asking a question on our forum, the answer is surely there ;)

Hey look at our Video tutorials, It's really helpful to understand how Acy works!
Last Edit: 6 years 1 month ago by Dax.
Please log in to post a reply

Re: Sending newsletter on a new database entry. 6 years 1 month ago #63726

  • Anonymous user
  • chetanmadaan's Avatar
  • Posts: 6
  • Karma: 0
Jemery -

thanks for your message... I feel like i should have written my question i little better may be.
Anyways, the above is helful... but i am trying to do is send a rewsletter using a plugin itself?? Is that possible.

Forinstance... i have a cron job which triggers the plugin every 5 mins or so and that plugin check a database table #__joomla_content_new

if there is a new entry to the table... we want a newsletter to be sent out.

Make sense?
Please log in to post a reply

Re: Sending newsletter on a new database entry. 6 years 1 month ago #63735

  • Anonymous user
  • Adrien's Avatar
  • Posts: 20233
  • Karma: 680
Hello,

Our Smart-Newsletter system already does that... via a cron Acy will be triggered (every 15 minutes by default) so plugins can decide if we should generate or not a new Newsletter:
www.acyba.com/en/support/documentation/6...tml#generateautonews
This is what we use to automatically send a new Newsletter including the newly created Joomla article for example.

So basically you create a Smart-Newsletter with your tag and then within your plugin you can block or generate a new Newsletter and also replace your tags.
Please have a look at our official documentation before posting a new message!

Do you like AcyMailing? We love your reviews!
We would appreciate if you could take 5 minutes to post a review on the Joomla! Extensions Directory.
We answered one of your question? Well, it's the best way to thank us!
Please log in to post a reply
Time to create page: 0.237 seconds
Powered by Kunena Forum