Skip to content

[7.x] Add theme to mailable properties - #33218

Merged
taylorotwell merged 2 commits into
laravel:7.xfrom
basselhossam:7.x
Jun 15, 2020
Merged

taylorotwell merged 2 commits into
laravel:7.xfrom
basselhossam:7.x

Conversation

@basselhossam

Copy link
Copy Markdown
Contributor

this allows the user to change the theme in the runtime and reflect it in queue because when the object is serialize for queue $this->theme would be gone if it's not preserved in the object properties

for example if my __construct looks like this

public function __construct($user)
{
     $this->theme = 'default-' . $user->user_lang;
}

I'm send an email to user and based on the user language I would like to set the theme

so by adding $theme to the properties it will be serialized and can be retrieved in the queue correctly

@taylorotwell
taylorotwell merged commit 44879ec into laravel:7.x Jun 15, 2020
@GrahamCampbell GrahamCampbell changed the title add theme to mailable properties [7.x] Add theme to mailable properties Jun 15, 2020
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