Need help with email list plugin

JackGoa

Member
Hi, I'm trying to figure out how the email list plugin works.

First off, can I do this with this plugin? I want to send an email to a subscriber list whenever I post a new article. Just a quick, 'Hi {firstname}, posted this article, blah blah, click here' (can this be automated by any chance in some other way whenever an article is posted?).

Then, I've updated today from Github, and I'm on J! 3.6. I've setup the email plugin as far as I think is right from the documentation. Then, when I go to my list, click on the little envelope, nothing happens. Is something supposed to happen? Am I missing something?

I have noticed, same as with some of my other sites, even though I updated from Github, Joomla still asks me to update Fabrik and says I am using version 3.4.3 even though under 'Manage', I have refreshed the cache and can see Fabrik 3.5 there.

Another thing I noticed, if I view the source of the little 'envelope' button, there is no 'href' attribute for the <a> tag. Shouldn't there be at least a 'href="#"'?

Any other tips for setting up the email list plugin as I described above are most welcome, the documentation assumes a certain degree of expertise which I don't seem to have as I don't quite understand everything described!! :p
 
The list email plugin is to send one or more list records to an email address. I am not sure that is what you are trying to accomplish. You want to send an email when a new article is posted. Is this a Joomla article? Or is the article data associated with a list.

If it is a Joomla article you may need an article plugin (nothing to do with Fabrik). If it is a record in a list then you can add the email plugin to the form to send the email.
 
The list email plugin is kinda confusing. Really it should be two separate plugins, but there's a lot of legacy involved. It works in one of two fundamental ways:

1) Use the list as the source of the addresses to send a message to, by specifying the field in the list that contains the email address, and (separate from the list itself) defining the message you want to send (which can be preset, or editable). So it uses the rows you select as the address book.

2) Send the data in the selected rows to one or more addresses (unrelated to the list, although you can specify another database table to use as an address book).

Neither of these methods can be automated.

You would need method 1, where you would set the "Get email address from" to "Defined in email-to field", and put the {table___element} placeholder of the element in your list which contains the email address.

Another alternative might be the form email plugin. Create a simple form from which you can create the message you want to send. Then use the form email plugin, and either use the "send to group" feature (if your subscribers all belong to a common J! group), or use the "Email to (eval)" to pull the emails from your subscriber table ...

Code:
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery->select('email')->from('yourlist');
$myDb->setQuery($myQuery);
$emails = $myDb->loadColumn();
return implode(',', $emails);

The form could be just a simple single WYSIWYG textarea where you can just create the entire message, or you could template it, and use (say) a join element to the J! article table to select the article.

-- hugh
 
Thanks for that Hugh. I think according to your instructions, I kind of had the idea, but missed something about the records. I understand what you mean, make the J! article table a list, specify the record I want to send, and send that to my defined list of email addresses? Sound about right?

It seems like a great option, and I'll be able to use placeholders in my article template, right? As mentioned though, it seems my 'email' button in the list view is broken. It does nothing when clicked on. (updated from github, J! and browser cache refreshed, etc etc)

Your second suggestion though, almost sounds a bit more attractive! Don't know why I did not think of that! Would I be able to use placeholders in the article if I use an article as a template?

And thanks so much for the code! It's a bit different from my very basic code! How do I add a WHERE clause in that query? I need to check one field to see if the user is subscribed or not? Would it look something like this?

PHP:
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery->select('email')->from('yourlist');
$myQuery->where('interested') == 'no';
$myDb->setQuery($myQuery);
$emails = $myDb->loadColumn();
return implode(',', $emails);

?
 
Ok cool, I got this to work! Pretty nifty.

There is one thing I can't do though, and that is use a placeholder for the name in the article template. Because the form I'm submitting obviously does not have a field for the name... it's not really a biggie. I just wanted to add the name of the subscriber in the email to make it more personalised.
 
Sherbet, also just realised my unsubscribe link won't work now because of the placeholder issue. I don't suppose there is a way I can get the email address from the email going out somehow to place in my unsubscribe link?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top