0

No luck getting Mailing to work with Civi 4.7.10 on Drupal despite all testing that says it should work. I think I've set every variable, token, requirement, etc there is. Even smartyDebug fails to show me an error. The Send test and Next are disabled (greyed out). Poking through the code in /var/www/drupal/sites/all/modules/civicrm/ang/crmMailing/BlockPreview.html I find

<button crm-icon="fa-paper-plane" title="{{crmMailing.$invalid || !testContact.email ? ts('Complete all required fields first') : ts('Send test message to %1', {1: testContact.email})}}" ng-disabled="crmMailing.$invalid || !testContact.email" ng-click="doSend({email: testContact.email})">{{ts('Send test')}}</button>

Although I've never used php before it seems || is a conditional whereby if crmMailing.$invalid is true 'Complete all required fields first' will be printed and if its false then the 'Send test' button is active and it will run doSend. The question is how can I force crmMailing.$invalid to always be false and trick the form into allowing me to proceed. While I could just trample over the code and not even bother with a test, I always hold out hope that somehow I'll figure out why the code won't work in my case and want to keep mods to minimum.

1 Answer 1

1

Well, it looks like I need glasses because there is no PHP in that bit of code. I was unaware you could do a conditional in HTML . . . until I tried it and found out you can. Anyway, this may be one hell of a crude hack so use at your own risk.

  1. Make a copy of sites/all/modules/civicrm/ang/crmMailing/BlockPreview.html
  2. Track down the line starting with

button crm-icon="fa-paper-plane" title="{{crmMailing.$invalid ||

  1. Get rid of crmMailing.$invalid || . You'll be left with !testContact.email . . .rest of line . . . crmMailing.$invalid appears twice in that line at ng-disabled. So set that to

ng-disabled="!testContact.email"

Getting rid of crmMailing.$invalid. I'd still like to know why this is set incorrectly. Where/How is it set?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.