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

ET-1854 Series Pass Email #2939

Merged
merged 26 commits into from
Mar 15, 2024

Conversation

lucatume
Copy link
Contributor

@lucatume lucatume commented Feb 26, 2024

Ticket: ET-1854

This PR adds support for the Series Pass email template.

Screencast

@lucatume lucatume self-assigned this Feb 26, 2024
src/Tickets/Emails/Admin/Preview_Modal.php Outdated Show resolved Hide resolved
src/Tickets/Emails/Admin/Preview_Modal.php Outdated Show resolved Hide resolved
src/Tickets/Emails/Admin/Preview_Modal.php Outdated Show resolved Hide resolved
src/Tickets/Emails/Admin/Preview_Modal.php Outdated Show resolved Hide resolved
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php Outdated Show resolved Hide resolved
);
}

public function get_default_subject(): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

[phpcs] reported by reviewdog 🐶
Squiz.Commenting.FunctionComment.Missing
Missing doc comment for function get_default_subject()

// @todo what about default subject set in Tickets Commerce?
}

public function get_default_heading(): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

[phpcs] reported by reviewdog 🐶
Squiz.Commenting.FunctionComment.Missing
Missing doc comment for function get_default_heading()

);
}

public function get_default_preview_context( $args = [] ): array {
Copy link
Contributor

Choose a reason for hiding this comment

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

[phpcs] reported by reviewdog 🐶
Squiz.Commenting.FunctionComment.Missing
Missing doc comment for function get_default_preview_context()

return [];
}

public function get_default_template_context(): array {
Copy link
Contributor

Choose a reason for hiding this comment

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

[phpcs] reported by reviewdog 🐶
Squiz.Commenting.FunctionComment.Missing
Missing doc comment for function get_default_template_context()

Copy link
Contributor

@tec-bot tec-bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

phpcs

src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|147 col 16| PEAR.Functions.FunctionCallSignature.MultipleArguments
Only one argument is allowed per line in a multi-line function call
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|147 col 18| PEAR.Functions.FunctionCallSignature.CloseBracketLine
Closing parenthesis of a multi-line function call must be on a line by itself
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|159 col 17| NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|159 col 17| SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|236 col 9| PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket
Opening parenthesis of a multi-line function call must be the last content on the line
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|236 col 87| PEAR.Functions.FunctionCallSignature.MultipleArguments
Only one argument is allowed per line in a multi-line function call
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|238 col 13| NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|238 col 13| SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|239 col 11| PEAR.Functions.FunctionCallSignature.CloseBracketLine
Closing parenthesis of a multi-line function call must be on a line by itself
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|249 col 8| Squiz.Commenting.FunctionComment.ParamCommentFullStop
Parameter comment must end with a full stop
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|270 col 18| PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket
Opening parenthesis of a multi-line function call must be the last content on the line
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|270 col 32| PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket
Opening parenthesis of a multi-line function call must be the last content on the line
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|274 col 11| PEAR.Functions.FunctionCallSignature.CloseBracketLine
Closing parenthesis of a multi-line function call must be on a line by itself
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|274 col 13| PEAR.Functions.FunctionCallSignature.CloseBracketLine
Closing parenthesis of a multi-line function call must be on a line by itself
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|284 col 8| Squiz.Commenting.FunctionComment.ParamCommentFullStop
Parameter comment must end with a full stop
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|303 col 8| Squiz.Commenting.FunctionComment.ParamCommentFullStop
Parameter comment must end with a full stop
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|328 col 8| Squiz.Commenting.FunctionComment.ParamCommentFullStop
Parameter comment must end with a full stop
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|369 col 78| NormalizedArrays.Arrays.CommaAfterLast.FoundSingleLine
A comma after the last array item in a single-line array is not allowed.
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|413 col 13| Squiz.Strings.DoubleQuoteUsage.NotRequired
String "tec_tickets_emails_dispatcher_series-pass_attachments" does not require double quotes; use single quotes instead
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php|440 col 13| Squiz.Strings.DoubleQuoteUsage.NotRequired
String "tec_tickets_emails_dispatcher_series-pass_attachments" does not require double quotes; use single quotes instead
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|64 col 17| WordPress.DateTime.RestrictedFunctions.date_date
date() is affected by runtime timezone changes which can cause date/time to be incorrectly displayed. Use gmdate() instead.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|70 col 1| PEAR.Functions.FunctionCallSignature.Indent
Multi-line function call not indented correctly; expected 12 spaces but found 16
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|70 col 88| PEAR.Functions.FunctionCallSignature.CloseBracketLine
Closing parenthesis of a multi-line function call must be on a line by itself
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|75 col 1| PEAR.Functions.FunctionCallSignature.Indent
Multi-line function call not indented correctly; expected 12 spaces but found 16
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|75 col 92| PEAR.Functions.FunctionCallSignature.CloseBracketLine
Closing parenthesis of a multi-line function call must be on a line by itself
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|80 col 1| PEAR.Functions.FunctionCallSignature.Indent
Multi-line function call not indented correctly; expected 12 spaces but found 16
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|80 col 95| PEAR.Functions.FunctionCallSignature.CloseBracketLine
Closing parenthesis of a multi-line function call must be on a line by itself
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|85 col 1| PEAR.Functions.FunctionCallSignature.Indent
Multi-line function call not indented correctly; expected 12 spaces but found 16
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|85 col 118| PEAR.Functions.FunctionCallSignature.CloseBracketLine
Closing parenthesis of a multi-line function call must be on a line by itself
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|90 col 1| PEAR.Functions.FunctionCallSignature.Indent
Multi-line function call not indented correctly; expected 12 spaces but found 16
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|90 col 100| PEAR.Functions.FunctionCallSignature.CloseBracketLine
Closing parenthesis of a multi-line function call must be on a line by itself
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|98 col 8| Generic.Commenting.DocComment.LongNotCapital
Doc comment long description must start with a capital letter
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Event_Post.php|144 col 1| PSR2.Files.EndFileNewline.NoneFound
Expected 1 newline at end of file; 0 found
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Preview_Post.php|87 col 23| Generic.Formatting.SpaceAfterCast.NoSpace
Expected 1 space after cast statement; 0 found
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Preview_Post.php|87 col 28| Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceAfterOpen
Expected 1 space after open parenthesis; 0 found
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Preview_Post.php|87 col 82| Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceBeforeClose
Expected 1 space before close parenthesis; 0 found
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Preview_Post.php|88 col 18| Generic.Formatting.MultipleStatementAlignment.NotSameWarning
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Preview_Post.php|103 col 46| WordPressVIPMinimum.Hooks.AlwaysReturnInFilter.VoidReturn
Please, make sure that a callback to 'shutdown' filter is returning void intentionally.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Preview_Post.php|103 col 46| WordPressVIPMinimum.Hooks.AlwaysReturnInFilter.VoidReturn
Please, make sure that a callback to 'shutdown' filter is returning void intentionally.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Preview_Post.php|103 col 46| WordPressVIPMinimum.Hooks.AlwaysReturnInFilter.MissingReturnStatement
Please, make sure that a callback to 'shutdown' filter is always returning some value.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Preview_Post.php|104 col 34| WordPress.PHP.YodaConditions.NotYoda
Use Yoda Condition checks, you must.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Preview_Post.php|147 col 1| PSR2.Files.EndFileNewline.NoneFound
Expected 1 newline at end of file; 0 found
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Series_Post.php|31 col 8| Squiz.Commenting.FunctionComment.MissingParamComment
Missing parameter comment
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Series_Post.php|38 col 6| Generic.Commenting.DocComment.SpacingAfter
Additional blank lines found at end of doc comment
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Series_Post.php|54 col 8| Squiz.Commenting.FunctionComment.MissingParamComment
Missing parameter comment
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Series_Post.php|61 col 6| Generic.Commenting.DocComment.SpacingAfter
Additional blank lines found at end of doc comment
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Mock_Series_Post.php|108 col 1| PSR2.Files.EndFileNewline.NoneFound
Expected 1 newline at end of file; 0 found
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|66 col 12| Squiz.Commenting.FunctionComment.Missing
Missing doc comment for function __construct()
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|129 col 63| WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 12 space(s) between ")" and double arrow, but found 16.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|139 col 63| WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 12 space(s) between ")" and double arrow, but found 16.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|147 col 63| WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 12 space(s) between ")" and double arrow, but found 16.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|155 col 63| WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 1 space(s) between ")" and double arrow, but found 5.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|185 col 63| WordPress.Arrays.MultipleStatementAlignment.LongIndexSpaceBeforeDoubleArrow
Expected 1 space between ")" and double arrow; 3 found.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|202 col 12| Squiz.Commenting.FunctionComment.WrongStyle
You must use "/**" style comments for a function comment
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|251 col 5| Squiz.Commenting.FunctionComment.MissingParamTag
Doc comment for parameter "$args" missing
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|256 col 8| Squiz.Commenting.FunctionComment.MissingParamName
Missing parameter name
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|263 col 23| PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket
Opening parenthesis of a multi-line function call must be the last content on the line
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|278 col 17| NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|278 col 17| SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|307 col 11| PEAR.Functions.FunctionCallSignature.CloseBracketLine
Closing parenthesis of a multi-line function call must be on a line by itself
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|335 col 17| WordPress.WP.I18n.NonSingularStringLiteralText
The $text parameter must be a single text string literal. Found: 'All films are shown at the Sidewalk Film Center - 1821 2nd Ave. N., Birmingham, AL 35203. ' .\n 'Seating is first come first serve, so arrive on time.' .\n ' All proceeds from this film series benefit Sidewalk Film Festival. Thank you for your support! '
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|356 col 61| Universal.NamingConventions.NoReservedKeywordParameterNames.defaultFound
It is recommended not to use reserved keyword "default" as function parameter name. Found: $default
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Series_Pass.php|381 col 53| Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure
Assignments must be the first block of code on a line
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Events.php|13 col 1| SlevomatCodingStandard.Namespaces.UnusedUses.UnusedUse
Type Tribe__Utils__Array (as Arr) is not used in this file.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Events.php|71 col 23| WordPress.PHP.YodaConditions.NotYoda
Use Yoda Condition checks, you must.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Events.php|98 col 17| Generic.Formatting.MultipleStatementAlignment.NotSameWarning
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Events.php|99 col 16| Generic.Formatting.MultipleStatementAlignment.NotSameWarning
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Events.php|105 col 1| PSR2.Files.EndFileNewline.NoneFound
Expected 1 newline at end of file; 0 found
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Series_Events_List.php|49 col 5| Squiz.Commenting.FunctionComment.MissingParamTag
Doc comment for parameter "$upcoming_events" missing
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Series_Events_List.php|54 col 8| Squiz.Commenting.FunctionComment.ParamNameNoMatch
Doc comment for parameter $template does not match actual variable name $upcoming_events
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Series_Events_List.php|56 col 12| Squiz.Commenting.FunctionComment.IncorrectTypeHint
Expected type hint "Template"; found "Upcoming_Events" for $template
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Series_Events_List.php|87 col 21| WordPress.PHP.YodaConditions.NotYoda
Use Yoda Condition checks, you must.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Series_Events_List.php|105 col 21| WordPress.WP.I18n.MissingTranslatorsComment
A function call to _x() with texts containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Series_Events_List.php|115 col 29| WordPress.WP.I18n.UnorderedPlaceholdersText
Multiple placeholders in translatable strings should be ordered. Expected "%1$d, %2$s", but got "%d, %s" in 'View all %d %s in this series'.
src/Tickets/Flexible_Tickets/Series_Passes/Emails/Upcoming_Series_Events_List.php|136 col 1| PSR2.Files.EndFileNewline.NoneFound
Expected 1 newline at end of file; 0 found
src/views/emails/template-parts/body/series-events-list.php|50 col 25| Squiz.PHP.EmbeddedPhp.NoSemicolon
Inline PHP statement must end with a semicolon
src/views/emails/template-parts/body/series-events-list.php|52 col 25| Squiz.PHP.EmbeddedPhp.NoSemicolon
Inline PHP statement must end with a semicolon
src/views/emails/template-parts/body/series-events-list.php|66 col 22| PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket
Space before opening parenthesis of function call prohibited
src/views/emails/template-parts/body/thumbnail.php|43 col 52| PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket
Expected 1 spaces before closing parenthesis; 0 found
src/views/emails/template-parts/header/head/series-pass-styles.php|15 col 2| Squiz.Commenting.FileComment.SpacingAfterComment
There must be exactly one blank line after the file comment

}

$preview_for_event = isset( $email_preview_context['post'] )
&& is_object( $email_preview_context['post'] )
Copy link
Contributor

Choose a reason for hiding this comment

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

[phpcs] reported by reviewdog 🐶
Universal.WhiteSpace.PrecisionAlignment.Found
Found precision alignment of 1 spaces.

}

$preview_for_event = isset( $email_preview_context['post'] )
&& is_object( $email_preview_context['post'] )
Copy link
Contributor

Choose a reason for hiding this comment

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

[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed
Tabs must be used to indent lines; spaces are not allowed

src/Tickets/Emails/Admin/Preview_Modal.php Outdated Show resolved Hide resolved
src/Tickets/Emails/Admin/Preview_Modal.php Outdated Show resolved Hide resolved
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php Outdated Show resolved Hide resolved
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php Outdated Show resolved Hide resolved
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php Outdated Show resolved Hide resolved
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php Outdated Show resolved Hide resolved
src/Tickets/Flexible_Tickets/Series_Passes/Emails.php Outdated Show resolved Hide resolved
@lucatume lucatume marked this pull request as ready for review March 8, 2024 13:59
@rafsuntaskin rafsuntaskin added the needs release Needs an associated release in Jira before merging. label Mar 8, 2024
Rework the logic in the method to include the series pass dates in the email to have them included in the PDF attachment as well.
When rendering the HTML for the PDF pass, the template input to the method will not be the Email one, but the Wallet Plus one.
For this reason, the controller is not using the input template, but hydrating its own, dedicated, instance.
@lucatume lucatume changed the base branch from release/G24.boxer to master March 13, 2024 12:42
@rafsuntaskin rafsuntaskin changed the base branch from master to release/G24.cocker-spaniel March 13, 2024 15:37
@rafsuntaskin rafsuntaskin removed the needs release Needs an associated release in Jira before merging. label Mar 13, 2024
@lucatume lucatume added the code review Status: requires a code review. label Mar 14, 2024
@rafsuntaskin
Copy link
Contributor

Minor changes only, otherwise great 👍

@lucatume lucatume merged commit 91271eb into release/G24.cocker-spaniel Mar 15, 2024
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code review Status: requires a code review.
Projects
None yet
3 participants