Getting [node:author:mail] from a paragraph event

Created on 17 June 2023, over 1 year ago
Updated 20 June 2023, over 1 year ago

Stumbled upon this after trialling rules and then business rules and have watched some of the videos on the ecaguide. Impressed by the flexibility of the ECA.

This is not really an 'Issue' but looking for some pointers. I think i am overlooking something obvious to others perhaps. In my case, i have a content type 'article' which uses referenced paragraph type 'details' which in turn has a date field 'date'. How do i access the node author email if i need to email on changes to the date field on update. The tokens for the [node:author:mail] do not seem to result in getting the email id.

In my case, the model start event is >> update content entity (paragraph) >> entity: field value changed (date) >> show message + send email

In my message displayed, anything from paragraph is displayed but ones from the node type (article) itself do not - such as [node:author:mail] , [node:author:field_first_name], etc.

Have I gone about this completely wrong? Do I need to load the node referenced to get the node author email?

Thanks

💬 Support request
Status

Fixed

Version

1.1

Component

Miscellaneous

Created by

🇦🇫Afghanistan lovedrupal6

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @lovedrupal6
  • 🇦🇫Afghanistan 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_.gz

    What 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 token entity, 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
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Thanks @lovedrupal6 for your feedback.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024