- Issue created by @lovedrupal6
- 🇦🇫Afghanistan lovedrupal6
Referrers create a voucher which is then exchanged for an item by clients that are referred later. the date this is exchanged is noted on a paragraph referenced field on the content type 'voucher'.
Content type called 'Voucher' which has a paragraph reference field called 'field_processing_paragraph' referrering to a paragraph which in turn has a field called 'field_date_used'.
To test further, created a usual non referenced date field called 'field_processing_body_field' in the content type 'voucher'.Changes in the usual non referenced date field 'field_processing_body_field' behave as intended as in the attached eca export bpmn_io-process_bfsztdi.tar.gz
However at a loss as to how obtain the original author email of the node to send an email when the 'field_date_used' changes from empty to a filled date.
Have tried starting with a paragraph type update as a start event - doeant have access to [node:author:mail] to send the email.
Have tried starting with the voucher node, loading the paragraph, loading original, loading new and displaying message - but not working as it should. this throws the email of the person updating rather than the node creator as in the attached bpmn_io-process_zgwbk6g.tar_.gzWhat am i doing wrong?
- 🇩🇪Germany jurgenhaas Gottmadingen
When starting with an event that's paragraph related, then ECA provides that paragraph entity as a token - and only that. So, the node is not known at this point. But you can load the parent entity of that paragraph into a token by the
Entity: load
action. To do so, you can refer to the token browser to find out about the available references:There is the token
[paragraph:parent_id]
. The paragraph is known as the tokenentity
, so you can load the node with the action by using[entity:parent_id]
as the node id.Once you have the node available as a token, you can use all of its token properties as well.
The issue with the wrong user when using the
[node:author]
token is interesting. Isn't it the other way round, that the node author is the creator but not the current editor? - 🇦🇫Afghanistan lovedrupal6
Dear Jürgen,
Your comment #4 has been so helpful and after a couple of hours of testing back and forth and reading your your comment to the word - finally have understood this. Attaching a model file here for anyone else who may find it helpful.
Content type called 'Coupon' has a referenced paragraph called 'Used on' which in turn has a field called 'Date'.
My use case is that the date will be left empty on creation of the coupon. When coupon is used, the date field is filled in by a user who can be different to the coupon node author. I need an email to be sent to the node author whenever the empty 'date' field in the paragraph 'used on' of the content type 'coupon' was filled in (coupon was used.
Thanks again Jürgen - much appreciated and kudos for such a high value module to you and others contributing.
- Status changed to Fixed
over 1 year ago 6:13am 20 June 2023 - 🇩🇪Germany jurgenhaas Gottmadingen
Thanks @lovedrupal6 for your feedback.
Automatically closed - issue fixed for 2 weeks with no activity.