Looking for developer for help with email plugin

billvv

Member
We're a small volunteer-based car club and have used Fabrik for several years for some of our website content. We've been looking for a way for our Board and Committee Chairs to batch email sub-groups withing our organization. We have developed several PHP applications that create tables for Fabrik presentation, including these sub-groups.

The Fabrik batch email plugin seems to be a good fit for a way to allow folks to create batch emails from the front end. Looking for a developer that can set up the Fabrik form/email plug-in for that purpose.
 
This is obviously the wrong place to post this because I have not received any responses. Could someone point me to the correct forum? Thanks.
 
Can you be a little more specific about your requirements?

And when you say the "batch email plugin", do you mean the scheduled task (cron) email plugin, or the list email plugin?

-- hugh
 
Sorry. I meant the form email plugin.

We're looking for a way for email to a subset of site members. For example, the Board Members of the organization, or all the members of the organization in a Region, or all of the members with a particular year of car.

We can extract the members for any subset we might want via existing databases and some PHP code.

In my attempts to use the form email plugin, I've run into several issues:
- Testing is difficult; there needs to be a way to see who's getting emails as a result of to: eval code without actually sending the emails and asking them if they got them.
- In trying to use Joomla 'groups', it appears that if a group has parents and the recipient is a member of the child and a parent, two emails are sent out.
- The emails that are received do not have the cc:s listed in the 'Reply to' list, so it's hard to initiate a conversation among/between the group. It's simply an email blast rather than the start of a discussion.
- I have no idea how to make the form screens look elegant. I'm sure there are ways, but my knowledge of HTML is primitive and CSS nearly non-existant; much less how to make it happen in Fabrik.

Are these issues that a developer can address?
 
First off, how many users are you talking about? So what would the largest batch of emails be?

We fairly specifically don't try to be a mailing list app. That's a very specialist application. We provide "best effort" delivery to "tens" of users, not hundreds. We don't provide any delivery reports (beyond displaying warnings about failed deliveries at form submission time), we don't handle bounces, etc. I'm not saying Fabrik is unreliable at mail delivery, simply that we don't provide any of the additional features a dedicated mailing list application would.

That said, as long as you aren't talking about hundreds of recipients in any given batch, and if you use a reliable SMTP relay, we do a good job of small scale delivery.

To answer some of your question:

Testing is difficult; there needs to be a way to see who's getting emails as a result of to: eval code without actually sending the emails and asking them if they got them.

Well, it's eval'ed code, so it's easy enough to log your own results. You could create a table ('mail_log') and before returning your list of comma separates addresses ...

Code:
// your code that set $myEmail (or whatever), then ...
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery();
// you could insert things like the formid and rowid as well, but at a minimum, time and addresses
$myQuery->insert('mail_log')->set('emails = ' . $myDb->quote($myEmails))->set('date_time = NOW()');
$myDb->setQuery($myQuery);
$myDb->execute();
// for testing, just return a test address ...
return 'test@test.test';

Then when you are happy, start returning $myEmails to actually send them, and leave the logging on if you want.

- In trying to use Joomla 'groups', it appears that if a group has parents and the recipient is a member of the child and a parent, two emails are sent out.

I'll have to check that, not something I've noticed, but it could be happening.

- The emails that are received do not have the cc:s listed in the 'Reply to' list, so it's hard to initiate a conversation among/between the group. It's simply an email blast rather than the start of a discussion.

We send the emails individually, one delivery for each user, we don't send a single email with multiple To or a Cc list. That's something we could add as an option, and I could include in a quote.

- I have no idea how to make the form screens look elegant. I'm sure there are ways, but my knowledge of HTML is primitive and CSS nearly non-existant; much less how to make it happen in Fabrik.

There is full templating available, but it does require some knowledge. I personally don't do that ind of work, as I'm focused on the nuts and bolts of functionality. But @mediaateam have some resources they can provide to do that stuff.

So, let me know about the numbers, and we'll go from there.

-- hugh
 
Most groups are 25 or less. One group has 300 members.

We send the emails individually, one delivery for each user, we don't send a single email with multiple To or a Cc list. That's something we could add as an option, and I could include in a quote.

Yes, interested in the above for sure. The cc:s should be the recipients of the emails and should be derived from the To: value so that we can create scripts that change the recipient list based on a dropdown element.

My big problem is that I want to be able to apply PHP code to select the recipients list.

I'm thinking I could write a script that collects each of my custom sub-sets of registered members into additional Joomla groups (one per sub-set) and then use the canned 'send to a group' dropdown in the email plug-in for the mailing.

I'll have to use another program for the 300 person newsletter mailings. These don't need the cc: list feature.

I like using Fabrik (in general, but also) because it allows our users to compose an email fairly easily in the front end.
 
Last edited:
25 or less would be fine.

Whether you use J! groups or your own grouping is really entirely down to the workflow and setup of your site. In your original post you gave "all members who own a particular car" as an example. That kind of "self selection" (I presume they fill out a form somewhere that lets them select their make of car) obviously doesn't lend itself to J! grouping.

Also, the group sending is static. You select a group in the settings, and that's who it goes to. It's not a dynamic thing.

Using custom code to build the recipient list would be more flexible. And it's easy to combine that with groups, if need be. It's only half a dozen lines of code to get all the users in a J! group, and build a list of their emails. Which could be combined with other filtering, so "all members from the "Alabama" regional group who own a 1963 Aston Martin DB4" (OK, small subset!).

-- hugh
 
Yes, I suppose that's the best way to do it. As a workaround to the parent/child group duplication issue, I wrote some code like that for an existing group.

As for testing, If I could write the email addresses into the body of the email before it's sent, then I'd have the complete test history in the test email. Can I do that with a PHP plugin? (I tried by sending "$formModel->updateFormData' to a form element using a string variable but that didn't work. It only worked for me when I included a true string.
 
Last edited:
Using updateFormData() won't work, as by the time your code runs, we've already built the array we use for placeholder handling, which copies the form model data (that updateFormData affects) and modifies it.

(updateFormData() is really only intended for using in pre-processing, typically in a PHP plugin running onBeforeProcess, to change the submitted data before we write it to the table)

You could probably modify $this->data[] directly, though. And it wouldn't have to be a field that exists as an element, you could just add something you want to use...

Code:
$this->data['debug_emails'] = $myEmails;

... and use {debug_emails} as your placeholder.

But as your code is eval'ed after we create the main message body, you should be able to insert/append it directly to $message ...

Code:
$message .= "Sending to: " . $myEmails . "<br />\n";

-- hugh
 
in PHP Form plugin, this worked:

$formModel->updateFormData('batch_email___reply_to',"board1@houseboatno4.com,board2@houseboatno4.com", true);

but this didn't:

$formModel->updateFormData('batch_email___reply_to'),$email, true);

It sounds like there's a couple ways; thanks!

Since I'm generating the list of recipients in Email Form plugin in the To: eval section; will either of those methods work within that code so that I don't have to run it twice (and wouldn't need the PHP Form plugin at all.
 
Back
Top