CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Scheduled Reminders | With Custom Activity Data
Pages: [1]

Author Topic: Scheduled Reminders | With Custom Activity Data  (Read 1078 times)

markjohan

  • I post occasionally
  • **
  • Posts: 102
  • Karma: 0
  • ..
  • CiviCRM version: 4.4.2
  • CMS version: Wordpress 3.6.1
  • MySQL version: 5.1.66-0+squeeze1
  • PHP version: 5.3.27
Scheduled Reminders | With Custom Activity Data
March 19, 2014, 11:34:41 am
Hello,  In CiviCRM you can make " Scheduled Reminders"

In the message, you can use custom data
(for example:
Straat + nr: {contact.street_address}
Postcode: {contact.postal_code}
Woonplaats: {contact.city}
Telefoonnummer: {contact.phone}
)

But i have some custom data for a activity, and how can i add this to the message..

I did go to the user fields, and when you hover on the edit button you see a ID in the url. So i used this in the message (for example {contact.custom_80} )
This won't work.

Has someone done this before and know how to use this?

Thanks!

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Scheduled Reminders | With Custom Activity Data
March 19, 2014, 12:12:38 pm
hi - not clear what type of Scheduled Reminder you are trying to use - an Activity based one, or something else?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Scheduled Reminders | With Custom Activity Data
March 19, 2014, 12:16:25 pm
Also, are you trying to include contact custom fields or activity custom fields?

markjohan

  • I post occasionally
  • **
  • Posts: 102
  • Karma: 0
  • ..
  • CiviCRM version: 4.4.2
  • CMS version: Wordpress 3.6.1
  • MySQL version: 5.1.66-0+squeeze1
  • PHP version: 5.3.27
Re: Scheduled Reminders | With Custom Activity Data
March 19, 2014, 12:26:02 pm
It is about this:

Send Scheduled Reminders (Always)
Sends out scheduled reminders via email
API Entity: Job
API Actie: send_reminder

And it is about the Custom Fields for an activity, So Activity Custom Fields yes.

Thanks! ;)

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Scheduled Reminders | With Custom Activity Data
March 19, 2014, 12:58:52 pm
sorry not understanding

if you go here http://drupal.demo.civicrm.org/civicrm/admin/scheduleReminders?action=add&reset=1

you will see it asks you what 'entity' - maybe i just don't see your answer for looking - but are you making a scheduled reminder for an Activity?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Scheduled Reminders | With Custom Activity Data
March 19, 2014, 01:05:55 pm
Do you have a contact custom field XX, so that you can check if {contact.custom_XX} works?

At the moment I can't find the documentation on including tokens for custom fields in emails, but I seem to remember that {contact.custom_XX} only works for certain types of custom data - I could be wrong though.

markjohan

  • I post occasionally
  • **
  • Posts: 102
  • Karma: 0
  • ..
  • CiviCRM version: 4.4.2
  • CMS version: Wordpress 3.6.1
  • MySQL version: 5.1.66-0+squeeze1
  • PHP version: 5.3.27
Re: Scheduled Reminders | With Custom Activity Data
March 19, 2014, 03:03:27 pm
Administer ->Customize Data and Screens -> Custom Fields,
Add New Custom Field Set.
Used for Activities, And some specific type.
Save
Create a custom Field.

Now go to Administer --> Communication --> Schedule Reminders --> Add reminder
Choose the right activity,

Now you can add in the HTML format field, for a Tokan. Here i want to use the custom Field i have created (see above).
But this is not in the list of the options in the Tokan.

How can i use this field in the HTML Format field?

{activity.custom_##}  won't work.

Does someone knows how to use this??

markjohan

  • I post occasionally
  • **
  • Posts: 102
  • Karma: 0
  • ..
  • CiviCRM version: 4.4.2
  • CMS version: Wordpress 3.6.1
  • MySQL version: 5.1.66-0+squeeze1
  • PHP version: 5.3.27
Re: Scheduled Reminders | With Custom Activity Data
March 21, 2014, 03:28:54 am
So is it possible to use tokans of a custom activity field?

Thanks

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Scheduled Reminders | With Custom Activity Data
March 21, 2014, 04:52:13 pm
it sounds like your testing is showing they are not available

i can confirm that the tokens don't get listed for custom Activity fields, while they do for custom Contact fields.

do you have any resources, coding or dollars, to help get this added?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

markjohan

  • I post occasionally
  • **
  • Posts: 102
  • Karma: 0
  • ..
  • CiviCRM version: 4.4.2
  • CMS version: Wordpress 3.6.1
  • MySQL version: 5.1.66-0+squeeze1
  • PHP version: 5.3.27
Re: Scheduled Reminders | With Custom Activity Data
March 22, 2014, 01:02:19 pm
hello Petednz,

they are indeed not available, but if you use some custom contact field(token) you will see this added to the HTML {contact.custom_ID). (where ID is the number of your User Field).
How do you can use this custom Activity field (token)

I have read about some "hook" ..??

Has someone a code to use this??

What do you mean with "do you have any resources, coding or dollars, to help get this added?"

Thanks,
M

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Scheduled Reminders | With Custom Activity Data
March 22, 2014, 03:00:40 pm
Quote from: markjohan on March 22, 2014, 01:02:19 pm
What do you mean with "do you have any resources, coding or dollars, to help get this added?"
Hi I meant that I don't think this is currently available and hence needs to be developed. So if you having coding abilities within your team, then  jump on IRC for some technical help (which is beyond me) or if you can help fund this, then check the Professionals list to get some quotes.

I will check with Eileen on Monday to see if we have already cooked anything up that does this but it doesn't ring any bells.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

markjohan

  • I post occasionally
  • **
  • Posts: 102
  • Karma: 0
  • ..
  • CiviCRM version: 4.4.2
  • CMS version: Wordpress 3.6.1
  • MySQL version: 5.1.66-0+squeeze1
  • PHP version: 5.3.27
Re: Scheduled Reminders | With Custom Activity Data
March 26, 2014, 12:28:27 am
Hello Petednz,

Thanks for your reply. If you know something, could you let me know?

Thanks.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Scheduled Reminders | With Custom Activity Data
March 26, 2014, 04:33:32 pm
I can't see any evidence of hooks being called - the relevant code is in CRM_Mailing_BAO_Mailing::commonCompose

    elseif ($className == 'CRM_Admin_Form_ScheduleReminders') {
      $tokens = array_merge(CRM_Core_SelectValues::activityTokens(), $tokens);
      $tokens = array_merge(CRM_Core_SelectValues::eventTokens(), $tokens);
      $tokens = array_merge(CRM_Core_SelectValues::membershipTokens(), $tokens);
    }

It could really do with some consolidation (& addition of custom tokens for all) - but I think you would need to sink some time in. If you enable smarty in mail
define('CIVICRM_MAIL_SMARTY', TRUE); you could use the {activity.activity_id} token to generate an api call within the smarty - which is not a nice solution either - but it might get you there.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

markjohan

  • I post occasionally
  • **
  • Posts: 102
  • Karma: 0
  • ..
  • CiviCRM version: 4.4.2
  • CMS version: Wordpress 3.6.1
  • MySQL version: 5.1.66-0+squeeze1
  • PHP version: 5.3.27
Re: Scheduled Reminders | With Custom Activity Data
May 11, 2014, 11:51:23 am
Thanks Eileen,

I think i won't get the result..  :(
Is it for example possible to add some code to the Activity.extra.tpl in the ../CRM/Activity/Form directory? So it will work?

If someone can offer me something please let me know.

capo

  • I post occasionally
  • **
  • Posts: 108
  • Karma: 5
Re: Scheduled Reminders | With Custom Activity Data
August 05, 2014, 06:46:11 am
@markjohan, I'm having exactly the same need you have. First, I tried to use the details activity field ({activity.details}) and it worked out but it was just a try. What I really wanted to do, was to use an activity custom field, so I'm having the same problem you're having. I've been taking a look at the code Eileen pointed and I've seen that, at CRM_Core_SelectValues::activityTokens() there is only a few activity fields being populated:

Code: [Select]
  static function &activityTokens() {
    static $tokens = NULL;

    if (!$tokens) {
      $tokens = array(
        '{activity.activity_id}' => ts('Activity ID'),
        '{activity.subject}' => ts('Activity Subject'),
        '{activity.details}' => ts('Activity Details'),
        '{activity.activity_date_time}' => ts('Activity Date Time'),
      );
    }
    return $tokens;
  }

I'm trying to see how difficult it is to add custom fields there, but it looks like something I can't do on my own. :(

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Scheduled Reminders | With Custom Activity Data

This forum was archived on 2017-11-26.