placeholder in email from field scheduled task

Hi,

In fabrikar Plans its possible to make scheduled tasks. I have made some and they are working. They get their data from a view table in the database.

Now i can put placeholders in almost every field of the email form in the plan settings. The reply to address, Reply to name, etc.

What is not possible is to use a placeholder in the Email from name, and email from fields. I really need that to be possible since we load dynamic email addresses via a pr0fessional service who provide the possibility we can send emails on behalve off our customers. Verified smtp etc.

This functionallity is in all email forms of fabrikar but not in the scheduled tasks. I thought this was allready changed by an earlier question of me but cannot find it.

At this moment this:

email from.png

Results in this:

email from 1.png

But it should return the data from the database.

Also when i put in the placeholder for the email address its not returning the email address. {g4e_orakel_urenreg_7d___gebruikemail}

Then it uses the default email of the website.

Can someone help me, to get the email from fields also accepting placeholders?? This is very important.
 
Ok @troester since i needed this functionallity quickly i tried to see what changes you made earlier. For me to get this to work, i tried to do the same.

I changed 'plugins/fabrik_cron/email' from: line 124-151
Code:
                            }

                            $thisSubject = $w->parseMessageForPlaceHolder($subject, $row);
                            $thisReplyTo = $w->parseMessageForPlaceHolder($replyTo, $row);
                            $thisReplyToName = $w->parseMessageForPlaceHolder($replyToName, $row);

                            if ($testMode)
                            {
                                $this->app->enqueueMessage($x . ': Would send subject: ' . $thisSubject);
                                $this->app->enqueueMessage($x . ': Would send to: ' . $thisTo);
                                $this->app->enqueueMessage($x . ': Would send Reply to: ' . $thisReplyTo);
                                $this->app->enqueueMessage($x . ': Would send Reply to name: ' . $thisReplyToName);
                            }
                            else
                            {
                                $res = FabrikWorker::sendMail(
                                    $MailFrom,
                                    $FromName,
                                    $thisTo,
                                    $thisSubject,
                                    $thisMsg,
                                    true,
                                    null,
                                    null,
                                    null,
                                    $thisReplyTo,
                                    $thisReplyToName
                                );

Into:

Code:
                            }

                            $thisMailFrom = $w->parseMessageForPlaceHolder($MailFrom, $row);
                            $thisFromName = $w->parseMessageForPlaceHolder($FromName, $row);
                            $thisSubject = $w->parseMessageForPlaceHolder($subject, $row);
                            $thisReplyTo = $w->parseMessageForPlaceHolder($replyTo, $row);
                            $thisReplyToName = $w->parseMessageForPlaceHolder($replyToName, $row);

                            if ($testMode)
                            {
                                $this->app->enqueueMessage($x . ': Would send subject: ' . $thisSubject);
                                $this->app->enqueueMessage($x . ': Would send to: ' . $thisTo);
                                $this->app->enqueueMessage($x . ': Would send email from: ' . $thisMailFrom);
                                $this->app->enqueueMessage($x . ': Would send email from name: ' . $thisFromName);
                                $this->app->enqueueMessage($x . ': Would send Reply to: ' . $thisReplyTo);
                                $this->app->enqueueMessage($x . ': Would send Reply to name: ' . $thisReplyToName);
                            }
                            else
                            {
                                $res = FabrikWorker::sendMail(
                                    $thisMailFrom,
                                    $thisFromName,
                                    $thisTo,
                                    $thisSubject,
                                    $thisMsg,
                                    true,
                                    null,
                                    null,
                                    null,
                                    $thisReplyTo,
                                    $thisReplyToName
                                );

Now in the email from name field placing an placeholder is working. YEAH!!

However placing a placeholder in the email from email field is not working. Then it is using the default email off the website and not the email of the placeholder.
How can i get this working? And if this is working can you add the changes to the github so i can use this also in future updates.

Final note, when i write an email address in it normally .. its using the given email address, combined with the name coming from the placeholder.
 
It's no good idea to use random email "From" addresses.

A serious email server will put such emails (displayed "From" email <> the sending email, which is configured in your Joomla settings) into spam or quarantine.
 
Yes, but when I use a professional party who makes the emailadresses verified i can send emails on behalf of the customer.

I checked with https://postmarkapp.com/support/article/846-how-can-i-send-on-behalf-of-my-users .. and they told when they verify the email, the sending will go allright.

So, now i have a query, what looks if a customer wants to use this function, and if yes, puts the validated email from the customer in the database .. and that value i grab with the placeholder. If no, the default egocentralis.nl email address is used.

It works everywhere, but not in the scheduled cron email form. Also not by changing the code like i did above. The email from name is changing with the placeholder.

Can you please help me?
 
The email scheduled task uses the Joomla config settings for sending.

You can do your own email sending (e.g. using this postmark API) with a php scheduled task.
 
mmm now i have some more questions.

in the email form, i can put hardcopy any email i want:
email from.png

In the from name, you see the placeholder, that is working.. so, the from name is dynamicly loaded.

So, if i can change the from email address manually.. into admin@egocentralis.nl or system@egocentralis.nl.. then its not depending on the joomla config settings for sending.. since i can change it.

And if i can change it....

Why is it not possible to load a placeholder into the from field of this same email form? I tried to change the /orakel.egocentralis.nl/public_html/plugins/fabrik_form/email/email.php

I achieved to get the from name to by dynamicly but the from email not.

I hope this is possible to put a placeholder in the from email field..

not only for me.. but, the smtp settings look if the from email is listed to the server... so my domain is 'egocentralis.nl

The from email should be jap@egocentralis.nl or admin@egocentralis.nl or noreply@egocentralis.nl

the from email can be " * @egocentralis.nl and then its always okay. I have tested this a lot of times.

But, when I use the postmark settings.. i can put in every email address i want as long as it get verified by postmark.

Long story short, in every email form (list/form plugin) the from field can by filled with a placeholder and is loading the email address i want to have from the database.

For me it would be the far best sollution, the scheduled task email form, also will have this behaviour?
 
And if you dont want to put it in the github.. okay.. but can you tell me what i do have to change.. to make the email from field accept placeholders.. because that should be possible while alle from fields in other mail plugins do accept this
 
Are trying to modify the cron email or the form email?

If you are sure that your email server/smtp and receiving servers are accepting your smtp and email combination, then ok, it's up to you.

I can't see why your cron email code should not do. What do you get in testmode?
You can debug with some var_dump(...);exit;

And email placeholders should use {... _raw}
 
Ok thank you.. my code works...

I forgot to create a element field ... to the view table.. so it was not possible to use the placeholder.. now it works... and i am a happy man..

I noticed it because of the testmodus was returning the placeholder... thanks for pointing me out

i am so sorry...

I would really appreciate if you want to set the use of placeholder in the from name and from email in github...

Can you do that??
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top