Skip to content

Conversation

@Alex-Jordan
Copy link
Contributor

…pients

<%= $ce->{institutionName} %> (sent from <%= link_to 'this page' => $emailableURL %>).
% }
</p>
% if ($c->stash->{numRecipients} > 1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be

Suggested change
% if ($c->stash->{numRecipients} > 1) {
% if ($numRecipients > 1) {

Stash values are converted into variables when templates are compiled. The only time you need to be careful and actually get them from the stash is if the stash value might not be defined. In that case the variable won't exist and the template will fail to compile. In this case this stash value will always be defined.

Comment on lines 14 to +17

% if ($c->stash->{numRecipients} > 1) {

<%= maketext('Message delivered to multiple recipients. Consider using reply-all.') =%>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be

Suggested change
% if ($c->stash->{numRecipients} > 1) {
<%= maketext('Message delivered to multiple recipients. Consider using reply-all.') =%>
% if ($numRecipients > 1) {
<%= maketext('Message delivered to multiple recipients. Consider using reply-all.') %>

The reasoning for the switch from $c->stash->{numRecients} to $numRecipients is the same as the other comment.

The rest is about spacing. The empty line before the conditional together with the empty line after it result in two empty lines in the text email. The =%> ending that you had at the end of the template substitution strips whitespace after the substitution which result in the empty line after it being removed. The result with your code is:

Feedback sent from setID:
page url here


Message delivered to multiple recipients. Consider using reply-all.
Username (userId) wrote:

With my changes it becomes

Feedback sent from setID:
page url here

Message delivered to multiple recipients. Consider using reply-all.

Username (userId) wrote:

Also, in the case that there is only one recipient so that this new message is not shown, then the empty line before and the emtpy line after both are in the output (the =%> substition doesn't happen in this case), and so even in that case there are two empty lines. The above changes cover this case also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants