3939use OCP \Mail \IEMailTemplate ;
4040use OCA \MonthlyStatusEmail \Service \ClientDetector ;
4141use OCA \MonthlyStatusEmail \Service \StorageInfoProvider ;
42+ use Psr \Log \LoggerInterface ;
4243
4344
4445class MessageProvider {
@@ -98,8 +99,14 @@ class MessageProvider {
9899 private $ shareManager ;
99100
100101
101- public function __construct (IConfig $ config , IURLGenerator $ generator ,IL10N $ l ,L10NFactory $ l10nFactory ,
102- ClientDetector $ clientDetector ,StorageInfoProvider $ storageInfoProvider ,IManager $ shareManager ) {
102+ /**
103+ * @var LoggerInterface
104+ */
105+ private $ logger ;
106+
107+
108+ public function __construct (IConfig $ config , IURLGenerator $ generator , IL10N $ l , L10NFactory $ l10nFactory ,
109+ ClientDetector $ clientDetector , StorageInfoProvider $ storageInfoProvider , IManager $ shareManager , LoggerInterface $ logger ) {
103110 $ this ->productName = $ config ->getAppValue ('theming ' , 'productName ' , 'Nextcloud ' );
104111 $ this ->entity = $ config ->getAppValue ('theming ' , 'name ' , 'Nextcloud ' );
105112 $ this ->generator = $ generator ;
@@ -109,8 +116,7 @@ public function __construct(IConfig $config, IURLGenerator $generator,IL10N $l,L
109116 $ this ->l10nFactory = $ l10nFactory ;
110117 $ this ->clientDetector = $ clientDetector ;
111118 $ this ->storageInfoProvider = $ storageInfoProvider ;
112-
113-
119+ $ this ->logger = $ logger ;
114120 }
115121
116122 /**
@@ -368,7 +374,7 @@ public function writeWelcomeMail(IEMailTemplate $emailTemplate, string $name): v
368374 public function writeShareMessage (IEMailTemplate $ emailTemplate , int $ shareCount ) {
369375 $ home = $ this ->generator ->getAbsoluteURL ('/ ' );
370376 $ userLang = $ this ->config ->getUserValue ($ this ->user ->getUID (), 'core ' , 'lang ' , null );
371- $ this ->l = $ this ->l10nFactory ->get ('nmc_email_template ' , $ userLang );
377+ $ this ->l = $ this ->l10nFactory ->get ('nmc_email_template ' , $ userLang );
372378 $ share = $ this ->l ->t ('Shares ' );
373379 $ content1 = $ this ->l ->t ('You have shared ' );
374380 $ content2 =$ this ->l ->t ('items of content you can manage your shares with once click. ' );
@@ -421,7 +427,7 @@ public function getFromAddress(): string {
421427 */
422428 public function writeGenericMessage (IEMailTemplate $ emailTemplate , IUser $ user , int $ messageId ): void {
423429
424- $ username = $ user ->getDisplayNameOtherUser ();
430+ $ username = $ user ->getDisplayName ();
425431 $ clientConditions = [];
426432 $ clientConditions = $ this ->ClientCondition ($ user );
427433 $ storageInfo = $ this ->storageInfoProvider ->getStorageInfo ($ user );
@@ -514,41 +520,41 @@ public function writeGenericMessage(IEMailTemplate $emailTemplate, IUser $user,
514520 $ emailTemplate ->addBodyText (
515521 <<<EOF
516522 <table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;">
517- <tr>
518- <td style="font-family: sans-serif; font-size: 14px; vertical-align: top;">
519- <p style="font-family: sans-serif; font-size: 14px; font-weight: bold; margin: 0; Margin-bottom: 16px;margin-top:32px;"> $ hello ' $ username',</p>
520- <p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 16px;"> $ content1</p>
521- <p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 16px;"> $ content2</p><p> $ content3 </p>
522- <p><a style="color:#e20074;text-decoration: none;" href=" $ content4Link"> $ content4</a></p>
523- <p style="margin-top:16px;margin-bottom:32px"> $ yourTelekom</p>
524-
525-
526- <table role="presentation" border="0"
527- cellpadding="0" cellspacing="0" class="btn btn-primary"
528- style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; box-sizing: border-box;">
529- <tbody>
530- <tr>
531- <td align="left" style="font-family: sans-serif; font-size: 14px; vertical-align: top; padding-bottom: 32px;">
532- <table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: auto;">
533- <tbody>
534- <tr>
535- <td style="font-family: sans-serif; font-size: 14px; vertical-align: top; background-color: #e20074; border-radius: 8px; text-align: center;"> <a href=" $ home" target="_blank" style="display: inline-block; color: #ffffff; background-color: #e20074; border: solid 1px #e20074; border-radius: 8px; box-sizing: border-box; cursor: pointer; text-decoration: none; font-size: 12px; font-weight: bold; margin: 0; padding: 12px 24px; text-transform: capitalize;"> $ OpenMagentaCLOUD</a> </td>
536- </tr>
537- </tbody>
538- </table>
523+ <tr>
524+ <td style="font-family: sans-serif; font-size: 14px; vertical-align: top;">
525+ <p style="font-family: sans-serif; font-size: 14px; font-weight: bold; margin: 0; Margin-bottom: 16px;margin-top:32px;"> $ hello ' $ username',</p>
526+ <p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 16px;"> $ content1</p>
527+ <p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 16px;"> $ content2</p><p> $ content3 </p>
528+ <p><a style="color:#e20074;text-decoration: none;" href=" $ content4Link"> $ content4</a></p>
529+ <p style="margin-top:16px;margin-bottom:32px"> $ yourTelekom</p>
530+
531+
532+ <table role="presentation" border="0"
533+ cellpadding="0" cellspacing="0" class="btn btn-primary"
534+ style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; box-sizing: border-box;">
535+ <tbody>
536+ <tr>
537+ <td align="left" style="font-family: sans-serif; font-size: 14px; vertical-align: top; padding-bottom: 32px;">
538+ <table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: auto;">
539+ <tbody>
540+ <tr>
541+ <td style="font-family: sans-serif; font-size: 14px; vertical-align: top; background-color: #e20074; border-radius: 8px; text-align: center;">
542+ <a href=" $ home" target="_blank" style="display: inline-block; color: #ffffff; background-color: #e20074; border: solid 1px #e20074; border-radius: 8px; box-sizing: border-box; cursor: pointer; text-decoration: none; font-size: 12px; font-weight: bold; margin: 0; padding: 12px 24px; text-transform: capitalize;"> $ OpenMagentaCLOUD</a>
543+ </td>
544+ </tr>
545+ </tbody>
546+ </table>
539547 </td>
540- </tr>
541- </tbody>
542- </table>
543- </td>
544- </tr>
548+ </tr>
549+ </tbody>
545550 </table>
546- </td>
547- </tr>
548-
549- <!-- END MAIN CONTENT AREA -->
550- </table>
551-
551+ </td>
552+ </tr>
553+ </table>
554+ </td>
555+ </tr>
556+ <!-- END MAIN CONTENT AREA -->
557+ </table>
552558 EOF ,
553559 ". "
554560 );
@@ -601,7 +607,7 @@ public function writeGenericMessage(IEMailTemplate $emailTemplate, IUser $user,
601607
602608 public function setUser (IUser $ user ) {
603609 $ this ->user = $ user ;
604- $ this ->l10n = $ this ->l10nFactory ->get ('monthly_status_email ' ,
610+ $ this ->l = $ this ->l10nFactory ->get ('monthly_status_email ' ,
605611 $ this ->config ->getUserValue ($ user ->getUID (), 'lang ' , null )
606612 );
607613 }
0 commit comments