-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/core#3177 Switch sms to use flexmailer token rendering #23516
Conversation
(Standard links)
|
5a6868b
to
f3a27bf
Compare
CRM/Mailing/BAO/SMSJob.php
Outdated
]; | ||
CRM_Utils_Hook::alterMailParams($mailParams, 'civimail'); | ||
$body = $mailParams['text']; | ||
$headers = ['To' => $fields['phone']]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised this worked at all in your testing? This should be $field['phone']
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opps - yeah that change was a tidy up I made right before commit
Seems ok with or without flexmailer, subject to the $field thing above. I only tested a simple scenario - was there a reason you think it would loop? |
Noting that if flexmailer isn't installed you see this in the preview section if you open it:
|
I thought it might loop cos I thought that The deprecation message is there currently - but people with |
Ok cool give me another day to check some things but otherwise this was good. |
@demeritcowboy wow - this is looking easier than I thought! |
When not using flexmailer and sending to multiple recipients, custom field tokens are blank whereas they're fine before the patch. According to http://stats.civicrm.org/?tab=sites about half of sites aren't using flexmailer. I'll try to see if it's something weird locally. But otherwise ok. The greeting token as in the original ticket works with flexmailer now but still doesn't without flexmailer, but I think that's expected here. (For reference mostly used RingCentral for testing.) |
Hmm yes it seems somehow this breaks custom field tokens when not using flexmailer. |
that's weird - I feel it shoulfd be no change when not using flexmailer |
The difference seems to be there is a bug in Mailing.preview - when the contact does not have an email it returns blank for custom fields. It seems partly because it doesn't pass on_hold = 0 to CRM_Contact_BAO_Query::apiQuery in getTokenDetails. You can see this if you make a bulk sms (or even a bulk emailing) and call So it's a little bit independent of the PR, except that the PR is relying on Mailing.preview. Maybe if there was some way for this line to know if it's an sms and then pass false for the skipOnHold param. |
@demeritcowboy maybe what I just pushed up will work |
thanks @demeritcowboy |
Overview
dev/core#3177 Switch sms to use flexmailer token rendering
Note that I have only been able to do limited testing on this so it needs much more robust testing
I found that what I COULD do was
UPDATE - look what I found - https://github.com/3sd/io.3sd.dummysms - haven't tried it though
Before
Regardless of whether flexmailer is installed tokens for SMS are rendered through smarty
After
I think the answer is to split out SMS processing from Mailing Job processing. To this end I have Created a new class
SMSJob
that extendsMailingJob
and overrides thedeliverGroup
function with one that does only the much lesser amount of work that is required for SMS - which really just needs body-text & a phone number it seemsTechnical Details
I suspect that when flexmailer is NOT installed this will result in a loop - options are to use tokenProcessor directly, not
mailing_preview
api or to simply callparent::deliverGroup
absent flexmailer. Note that I didn't see any evidence of theSMS
screen offering any non-contact tokens so the latter might be fineComments
@totten @seamuslee001