Skip to content

Add support for multiple Actions in Mail Notifications #56665

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

Closed

Conversation

ahinkle
Copy link
Contributor

@ahinkle ahinkle commented Aug 15, 2025

This PR adds support for multiple action method calls in mail notifications.

Currently, calling ->action() more than once would only render the last button, without any exception or warning.

For example, given the following mail message:

return (new MailMessage)
    ->line('You have been invited to join a team!')
    ->action('Accept', 'https://example.com/accept')
    ->action('Reject', 'https://example.com/reject');

It currently renders with only the last action on the chain:

image

With this PR, it allows multiple action methods to render:

image

Secondly, it enables mixing line and action calls in any order.

return (new MailMessage)
    ->line('Intro line 1')
    ->line('Intro line 2')
    ->action('Accept', 'https://example.com/accept')
    ->line('Outro line 1')
    ->action('Reject', 'https://example.com/reject')
    ->line('Outro line 2');
image

This supports backwards compatibility with no breaking changes.

@ahinkle ahinkle closed this Aug 15, 2025
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.

1 participant