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

[9.x] Add raw content property for mailables #44703

Merged
merged 4 commits into from
Oct 25, 2022
Merged

[9.x] Add raw content property for mailables #44703

merged 4 commits into from
Oct 25, 2022

Conversation

Xammie
Copy link
Contributor

@Xammie Xammie commented Oct 24, 2022

This is a follow up from #44696 (comment).

This PR introduces a new property and method on the mailable content class to supply a raw html string.

public function content() {
    return new Content(
        raw: 'raw html string'
    );
}

The classic mailable approach already has this feature.

public function build() {
    return $this->html('raw html string');
}

@driesvints driesvints marked this pull request as draft October 24, 2022 09:26
@driesvints
Copy link
Member

Hi there. We fixed the failing tests on 9.x which are causing this PR to fail as well. Can you please rebase your PR with 9.x and mark this PR as ready for review when all tests are passing again? Thanks

@Xammie Xammie marked this pull request as ready for review October 24, 2022 10:23
@ascentcreative
Copy link

Are there plans for a rawText() method at all?

I'm using soundasleep/html2Text to convert my HTML view to text-only, and it would be great to be able to pass that value into the Content. At the moment I can fudge it by passing the text via a blade, but it's a bit clunky...

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.

4 participants