2024 Dec 13 9:14 AM - edited 2024 Dec 13 10:53 AM
Hi!
I've successfully created a business rule which is scheduled to run every day and to send out a reminder e-mail to certain receivers.
Those receivers do get individual texts in the mail's body so I cannot add all receivers into the appropriate CC, BCC etc. fields.
To select the necessary activities, I'm using this custom CoreSQL query below. For testing purposes, I'm limiting the result to two activities only, see WHERE statement.
Hoping that this will limit the amount of sent out emails to two.
SELECT activity FROM Activity activity INNER JOIN ServiceCall sc ON sc = activity .object.objectId AND activity.object.objectType = 'SERVICECALL' WHERE activity.executionStage = 'DISPATCHING' AND (activity.udf.AcCustomerEmail IS NOT NULL ) AND ( datediff(day, COALESCE(activity.udf.ACReminderDueTo, activity.createDateTime ), Now()) > 90 ) AND ( sc.udf.serviceCallObjectEmail IS NOT NULL OR sc.udf.serviceCallCustomerEmail IS NOT NULL ) AND activity.executionStage = 'DISPATCHING' AND sc.problemTypeCode = 'AUM' AND sc.typeCode = 'Z_DK' and ( activity.id = '04CFA494E159483C9E651A812F0592E8' or activity.id = '44D5B71619764B1981AE8E7E57B628AC' )
I expected to get two activities as a result and would liket to send an email to the receivers those emails can be found in an UDF in the service call.
As mentioned before, validating or executing works, but only for the one activity I must specify while validating/executing the rule.
OTH, when the business-rule gets executed a certain point of time. I still get only one email and not two. I guess it's due to the execution count property of the email action as below.
I did not found any help regarding on how to send out bulk emails if the result set of a query returns more than one record.
Any hint appreciated!
Edit: It already works as expected, however, I ignored some conditions that prevented the emails from being sent out..So question is solved!
Request clarification before answering.
| User | Count |
|---|---|
| 12 | |
| 10 | |
| 8 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.