Posts: 3,565
Threads: 36
Joined: Apr 2014
Reputation:
49
I didn't add it in workflows because there is already a way to get each part of the date there, no?
Joe
TSolucio
Posts: 3,565
Threads: 36
Joined: Apr 2014
Reputation:
49
Yes, here: format_date
Workflows are totally different, MUCH more powerful and the (near) future of templating email in coreBOS
Joe
TSolucio
Posts: 59
Threads: 17
Joined: Jan 2017
Reputation:
2
Could you please point out how I can use format_date in workflow emails?
I want to send an email with the appointment date in the subject line when the appointment is scheduled.
These do not work:
- format_date('d.m.Y', $date_start)
- $(format_date('d.m.Y', $date_start))
- $date_start(format_date('d.m.Y'))
Posts: 59
Threads: 17
Joined: Jan 2017
Reputation:
2
I am using this
$(general : (__WorkflowFunction__) format_date($date_start, "d.m.Y") )
but still get an error: Fatal error: Uncaught Exception: Was expecting a closing bracket in /.../modules/com_vtiger_workflow/expression_engine/VTParser.inc:132 Stack ...
I don't see a missing bracket.
This custom function works and seems to have the same structure:
$(general : (__WorkflowFunction__) __email_begruessung( $(cto_id : (Contacts) salutationtype), $(cto_id : (Contacts) lastname), $(cto_id : (Contacts) cf_833), $(cto_id : (Contacts) cf_836) ) )
Posts: 3,565
Threads: 36
Joined: Apr 2014
Reputation:
49
Have you tried with single quotes? all the examples I linked above seem to use those instead of double quotes
Joe
TSolucio
Posts: 59
Threads: 17
Joined: Jan 2017
Reputation:
2
08-16-2018, 09:26 PM
(This post was last modified: 08-16-2018, 09:41 PM by partnerwerk.)
You are right, but it is not enough.
This one works:
$(general : (__WorkflowFunction__) format_date($date_start,'d.m.Y') )
But only if I add a space after the final bracket. Maybe that is not intended? Took me a while to find out.
PS: Actually I even need to put a dot on the same line in order to preserve the empty space after the function. Otherwise soemthing gets stripped and the function is not executed with error message ”missing bracket”.
Posts: 3,565
Threads: 36
Joined: Apr 2014
Reputation:
49
08-16-2018, 11:37 PM
(This post was last modified: 08-16-2018, 11:38 PM by joebordes.)
It is rather hard to create a unique string inside a string that we can capture and process accordingly. If you look at the examples I sent in the link above you will see those spaces you are talking about.
Glad you got it working
Joe
TSolucio
Posts: 59
Threads: 17
Joined: Jan 2017
Reputation:
2
The Wysywig editor is cutting out these spaces in many cases. So adding a free space and a dot after a workflow function seems to be a safe way to get them processed. But there are some cases where a dot is annoying or misleading.
It also looks like it is impossible to have two functions on one line. When I break them up into two lines (with <p></p> tags for each) it works. When I have them on one line the second is just disappearing.