Commit 1e0d15f6 authored by catch's avatar catch
Browse files

Issue #3212034 by longwave, quietone: Account emails are missing newlines due to malformed YAML

(cherry picked from commit 95edf33a)
parent d69c7eba
cancel_confirm:
body: "[user:display-name],
body: |-
[user:display-name]
A request to cancel your account has been made at [site:name].
A request to cancel your account has been made at [site:name].
You may now cancel your account on [site:url-brief] by clicking this link or copying and pasting it into your browser:
You may now cancel your account on [site:url-brief] by clicking this link or copying and pasting it into your browser:
[user:cancel-url]
[user:cancel-url]
NOTE: The cancellation of your account is not reversible.
NOTE: The cancellation of your account is not reversible.
This link expires in one day and nothing will happen if it is not used.
This link expires in one day and nothing will happen if it is not used.
-- [site:name] team"
-- [site:name] team
subject: 'Account cancellation request for [user:display-name] at [site:name]'
password_reset:
body: "[user:display-name],
body: |-
[user:display-name],
A request to reset the password for your account has been made at [site:name].
A request to reset the password for your account has been made at [site:name].
You may now log in by clicking this link or copying and pasting it into your browser:
You may now log in by clicking this link or copying and pasting it into your browser:
[user:one-time-login-url]
[user:one-time-login-url]
This link can only be used once to log in and will lead you to a page where you can set your password. It expires after one day and nothing will happen if it's not used.
This link can only be used once to log in and will lead you to a page where you can set your password. It expires after one day and nothing will happen if it's not used.
-- [site:name] team"
-- [site:name] team
subject: 'Replacement login information for [user:display-name] at [site:name]'
register_admin_created:
body: "[user:display-name],
body: |-
[user:display-name],
A site administrator at [site:name] has created an account for you. You may now log in by clicking this link or copying and pasting it into your browser:
A site administrator at [site:name] has created an account for you. You may now log in by clicking this link or copying and pasting it into your browser:
[user:one-time-login-url]
[user:one-time-login-url]
This link can only be used once to log in and will lead you to a page where you can set your password.
This link can only be used once to log in and will lead you to a page where you can set your password.
After setting your password, you will be able to log in at [site:login-url] in the future using:
After setting your password, you will be able to log in at [site:login-url] in the future using:
username: [user:name]
password: Your password
username: [user:name]
password: Your password
-- [site:name] team"
-- [site:name] team
subject: 'An administrator created an account for you at [site:name]'
register_no_approval_required:
body: "[user:display-name],
body: |-
[user:display-name],
Thank you for registering at [site:name]. You may now log in by clicking this link or copying and pasting it into your browser:
Thank you for registering at [site:name]. You may now log in by clicking this link or copying and pasting it into your browser:
[user:one-time-login-url]
[user:one-time-login-url]
This link can only be used once to log in and will lead you to a page where you can set your password.
This link can only be used once to log in and will lead you to a page where you can set your password.
After setting your password, you will be able to log in at [site:login-url] in the future using:
After setting your password, you will be able to log in at [site:login-url] in the future using:
username: [user:name]
password: Your password
username: [user:name]
password: Your password
-- [site:name] team"
-- [site:name] team
subject: 'Account details for [user:display-name] at [site:name]'
register_pending_approval:
body: "[user:display-name],
body: |-
[user:display-name],
Thank you for registering at [site:name]. Your application for an account is currently pending approval. Once it has been approved, you will receive another email containing information about how to log in, set your password, and other details.
Thank you for registering at [site:name]. Your application for an account is currently pending approval. Once it has been approved, you will receive another email containing information about how to log in, set your password, and other details.
-- [site:name] team"
-- [site:name] team
subject: 'Account details for [user:display-name] at [site:name] (pending admin approval)'
register_pending_approval_admin:
body: "[user:display-name] has applied for an account.
body: |-
[user:display-name] has applied for an account.
[user:edit-url]"
[user:edit-url]
subject: 'Account details for [user:display-name] at [site:name] (pending admin approval)'
status_activated:
body: "[user:display-name],
body: |-
[user:display-name],
Your account at [site:name] has been activated.
Your account at [site:name] has been activated.
You may now log in by clicking this link or copying and pasting it into your browser:
You may now log in by clicking this link or copying and pasting it into your browser:
[user:one-time-login-url]
[user:one-time-login-url]
This link can only be used once to log in and will lead you to a page where you can set your password.
This link can only be used once to log in and will lead you to a page where you can set your password.
After setting your password, you will be able to log in at [site:login-url] in the future using:
After setting your password, you will be able to log in at [site:login-url] in the future using:
username: [user:account-name]
password: Your password
username: [user:account-name]
password: Your password
-- [site:name] team"
-- [site:name] team
subject: 'Account details for [user:display-name] at [site:name] (approved)'
status_blocked:
body: "[user:display-name],
body: |-
[user:display-name],
Your account on [site:name] has been blocked.
Your account on [site:name] has been blocked.
-- [site:name] team"
-- [site:name] team
subject: 'Account details for [user:display-name] at [site:name] (blocked)'
status_canceled:
body: "[user:display-name],
body: |-
[user:display-name],
Your account on [site:name] has been canceled.
Your account on [site:name] has been canceled.
-- [site:name] team"
-- [site:name] team
subject: 'Account details for [user:display-name] at [site:name] (canceled)'
langcode: en
<?php
namespace Drupal\Tests\user\Kernel;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests that user.mail default settings are parsed correctly.
*
* @group user
*/
class UserMailDefaultsTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['user', 'system'];
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->installConfig(['user']);
}
/**
* Tests that each user mail contains blank lines.
*
* @dataProvider userMailsProvider
*/
public function testMailDefaults($key) {
$body = $this->config('user.mail')->get("$key.body");
$this->assertStringContainsString("\n\n", $body);
}
/**
* Data provider for user mail testing.
*
* @return array
* Array of arrays containing the set of user mail configuration keys.
*/
public function userMailsProvider() {
return [
['cancel_confirm'],
['password_reset'],
['status_activated'],
['status_blocked'],
['status_canceled'],
['register_admin_created'],
['register_no_approval_required'],
['register_pending_approval'],
['register_pending_approval_admin'],
];
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment