Skip to content

Commit f2df30b

Browse files
bug #50473 [Notifier] Fix ContactEveryoneOptions (nicolas-grekas)
This PR was merged into the 6.3 branch. Discussion ---------- [Notifier] Fix ContactEveryoneOptions | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Thanks to `@franckranaivo` in #50349 (comment) Commits ------- 8dd9d93 [Notifier] Fix ContactEveryoneOptions
2 parents 5c46e7e + 8dd9d93 commit f2df30b

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

src/Symfony/Component/Notifier/Bridge/ContactEveryone/ContactEveryoneOptions.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
/**
1717
* @author gnito-org <https://github.com/gnito-org>
18+
*
19+
* @see https://ceo-be.multimediabs.com/attachments/hosted/lightApiManualsFR
1820
*/
1921
final class ContactEveryoneOptions implements MessageOptionsInterface
2022
{
@@ -35,7 +37,7 @@ public function getRecipientId(): ?string
3537
*/
3638
public function diffusionName(string $diffusionName): static
3739
{
38-
$this->options['diffusion_name'] = $diffusionName;
40+
$this->options['diffusionname'] = $diffusionName;
3941

4042
return $this;
4143
}
@@ -50,6 +52,28 @@ public function category(string $category): static
5052
return $this;
5153
}
5254

55+
/**
56+
* @param 'fr_FR'|'en_GB' $locale
57+
*
58+
* @return $this
59+
*/
60+
public function locale(string $locale): static
61+
{
62+
$this->options['locale'] = $locale;
63+
64+
return $this;
65+
}
66+
67+
/**
68+
* @return $this
69+
*/
70+
public function unicode(bool $unicode): static
71+
{
72+
$this->options['xcharset'] = $unicode ? 'true' : 'false';
73+
74+
return $this;
75+
}
76+
5377
public function toArray(): array
5478
{
5579
return $this->options;

src/Symfony/Component/Notifier/Bridge/ContactEveryone/ContactEveryoneTransport.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ protected function doSend(MessageInterface $message): SentMessage
7373
}
7474

7575
$options = $message->getOptions()?->toArray() ?? [];
76-
$options['xcharset'] = 'true';
76+
$options['category'] ??= $this->category;
77+
$options['diffusionname'] ??= $this->diffusionName;
78+
$options['xcharset'] ??= 'true';
7779
$options['token'] = $this->token;
7880
$options['to'] = $message->getPhone();
7981
$options['msg'] = $message->getSubject();

src/Symfony/Component/Notifier/Bridge/ContactEveryone/Tests/ContactEveryoneOptionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testContactEveryoneOptions()
2424

2525
self::assertSame([
2626
'category' => 'test_category',
27-
'diffusion_name' => 'test_diffusion_name',
27+
'diffusionname' => 'test_diffusion_name',
2828
], $contactEveryoneOptions->toArray());
2929
}
3030
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy