Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record.id not rendering in subject field #835

Closed
jamesrichardbrett opened this issue Aug 5, 2022 · 4 comments
Closed

record.id not rendering in subject field #835

jamesrichardbrett opened this issue Aug 5, 2022 · 4 comments

Comments

@jamesrichardbrett
Copy link

Hi

We've the {record.id} magic string in the subject of an email that gets sent once a form is submitted. The following

image

when the email arrives the subject display like this:

image

and the following appears in the logs

image

If I use {record.uniqueid} it works fine.

I'm using Umbraco 10.0.1, Forms 10.0.5.

Cheers
James

@jamesrichardbrett jamesrichardbrett changed the title record.is not rendering in subject field record.id not rendering in subject field Aug 5, 2022
@AndyButland
Copy link

AndyButland commented Aug 5, 2022

I don't think these two things are related @jamesrichardbrett.

With regard the record Id, this will always be zero during the submission stage of the form entry, as when the workflows run the record hasn't yet been stored in the database in order to get an integer Id. The unique Id is available as you've noted, as this is set in code (rather than by the database) and hence is available before the record is saved.

That said, we should be able to improve things here. If you were to add it to the set of workflows that run on approval, that would work - as the record is saved between submitting and approving. So I was going to suggest that... but then realised you can't add workflows to the approval stage unless you are doing post-moderation, which I suspect here you aren't.

We'll have a look and see if we can do to support this.

@OwainWilliams
Copy link

@AndyButland We were working from the docs (https://our.umbraco.com/documentation/Add-ons/UmbracoForms/Developer/Magic-Strings/#parsing-umbraco-form-field) which mentioned we could use the {record.id} from form submission for automated emails. If record.id shouldn't be in the docs I can update the docs to reflect this.

@AndyButland
Copy link

If you don't mind making an update to note that record.id will only be accessible on workflows triggered "on approve" rather than "on submit", that would be great, and will always be the case. Thanks.

@AndyButland
Copy link

Some time back we took a suggestion that displaying allowing addition of "on approve" workflows didn't make sense unless post moderation and hence a manual approval process is in place for a form. That seemed to make sense so these options were removed from the user interface.

However you've identified a reason here why you should be able to attach workflows to "submit" or "approve" whether or not your are post-moderating... in that only workflows running on the latter will have access to the record's integer Id.

As such from the next patch release we'll make available editing workflows for both "submit" and "approve" irrespective on the post moderation setting for the form.

OwainWilliams added a commit to OwainWilliams/UmbracoDocs that referenced this issue Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants