Skip to content

[2.x] Logo in mail template resolves to flarum local disk by default #4604

@luceos

Description

@luceos

Current Behavior

The community logo attached to every email is retrieved using this code:

            @if ($settings->get('logo_path'))
                <img src="{{ $url->to('forum')->base() . '/assets/' . $settings->get('logo_path') }}" alt="{{ $settings->get('forum_title') }}" class="Header-logo">
            @else
                {{ $settings->get('forum_title') }}
            @endif

Reference: vendor/flarum/core/views/email/html.blade.php

As a consequence communities that use a bucket/cdn will always sent emails where the logo is broken.

Steps to Reproduce

.

Expected Behavior

The logo url should be based off of the disk config url value, not the base URL the UrlGenerator creates.

Screenshots

No response

Environment

  • Flarum version: x.y.z
  • Website URL: http://example.com
  • Webserver: [e.g. apache, nginx]
  • Hosting environment: [e.g. shared, vps]
  • PHP version: x.y.z
  • Browser: [e.g. chrome 67, safari 11]

Output of php flarum info

Output of "php flarum info", run this in terminal in your Flarum directory.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions