Closed fulldecent closed 1 month ago
There is a plugin that does something similar, see https://resources.phplist.com/plugin/conditionalplaceholder
It is no longer supported but could be used as-is, but you would need to fix any problems yourself, or as a starting-point if you wanted to implement different syntax.
Thank you @bramley that looks great.
I will look into using this and fork and supporting that project.
However at the moment, this is blocked for me at https://github.com/phpList/phplist3/issues/1049
Closing here as this might be out-of-scope for phplist since it can live in a module.
Hello, I am preparing my first campaign in phpList, coming from Mailchimp. And I am trying to implement this kind of mail merge:
and
I understand the second one is easier, I could update my data source to address that.
For the first one, lines are shown or not shown in the template based on conditions (i.e. whether a variable is or is not empty).
Has anybody found a workaround for this workload? Or has anybody considered implementing conditionals in phpList's templating language, or adopting another language like php-liquid as the templating language?
Workarounds
I am considering to add extra attributes to my email list to address my specific problem above. For example I would use [LINE1] / [LINE2] / [LINE3] / [LINE4] and fill in those lines based on the first, second, third, fourth, ... expired certification.
Then in my template I would directly include [LINE1] / [LINE2] / [LINE3] / [LINE4]. The last lanes would be blank depending on how many certifications there are and the recipient would just see blank lines.
"Free"
I do understand that phplist3 is free software and anybody could implement this feature request but is under no obligation to support me.
I am opening this issue in the interest to find other people that may have also considered this use case. And also I would like to ask the maintainers here if there is appetite to merge a PR if such a feature is provided (and which design approach(es) may be acceptable).
Thank you!