Merged PR 572: メール内容多言語対応、可変文字列対応
## 概要 [Task3022: メール内容多言語対応、可変文字列対応](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3022) - 元PBI or タスクへのリンク(内容・目的などはそちらにあるはず) - 何をどう変更したか、追加したライブラリなど - 仮だったメール内容について、ユーザ提示の内容とし、可変部分の対応を行いました。 - このPull Requestでの対象/対象外 - 複数言語の対応について、現状は各言語の内容を縦に並べる形としています。 11/14現在、奥澤さんが調査・調整中で、最終的な他言語対応は 「プロダクト バックログ項目 1660: メール送信機能の実装」の中で実施になります。 - [メール内容の外出しなど、編集しやすくする対応についても「プロダクト バックログ項目 1660: メール送信機能の実装」にて実施になります。 - 影響範囲(他の機能にも影響があるか) ## レビューポイント - 特にレビューしてほしい箇所 - 特筆してみていただきたい部分はありません。全体見ていただき違和感なければOKと思っています。 - 軽微なものや自明なものは記載不要 - 修正範囲が大きい場合などに記載 - 全体的にや仕様を満たしているか等は本当に必要な時のみ記載 ## UIの変更 - https://ndstokyo.sharepoint.com/:f:/r/sites/Piranha/Shared%20Documents/General/OMDS/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88/Task3022?csf=1&web=1&e=0PB6iI ## 動作確認状況 - ユニットテスト実施+ローカルで確認 ## 補足 - 相談、参考資料などがあれば
This commit is contained in:
parent
effbfe9d46
commit
aeb2eb392a
@ -14,9 +14,11 @@ import {
|
||||
DateWithZeroTime,
|
||||
ExpirationThresholdDate,
|
||||
} from "../common/types/types";
|
||||
import { getMailFrom } from "../common/getEnv/getEnv";
|
||||
import { createMailContentOfLicenseShortage } from "../sendgrid/mailContents/U103ShortageAlert";
|
||||
import { createMailContentOfLicenseExpiringSoon } from "../sendgrid/mailContents/U104ExpiringSoonAlert";
|
||||
import { AdB2cService } from "../adb2c/adb2c.service";
|
||||
import { SendGridService } from "../sendgrid/sendgrid.service";
|
||||
import { getMailFrom } from "../common/getEnv/getEnv";
|
||||
|
||||
export async function licenseAlertProcessing(
|
||||
context: InvocationContext,
|
||||
@ -194,7 +196,11 @@ export async function licenseAlertProcessing(
|
||||
// ライセンス不足メール
|
||||
if (targetAccount.shortage !== 0) {
|
||||
const { subject, text, html } =
|
||||
await sendgrid.createMailContentOfLicenseShortage();
|
||||
await createMailContentOfLicenseShortage(
|
||||
targetAccount.companyName,
|
||||
targetAccount.shortage,
|
||||
targetAccount.parentCompanyName
|
||||
);
|
||||
// メールを送信
|
||||
try {
|
||||
await sendgrid.sendMail(
|
||||
@ -218,7 +224,11 @@ export async function licenseAlertProcessing(
|
||||
// ライセンス不足メール
|
||||
if (targetAccount.shortage !== 0) {
|
||||
const { subject, text, html } =
|
||||
await sendgrid.createMailContentOfLicenseShortage();
|
||||
await createMailContentOfLicenseShortage(
|
||||
targetAccount.companyName,
|
||||
targetAccount.shortage,
|
||||
targetAccount.parentCompanyName
|
||||
);
|
||||
// メールを送信
|
||||
try {
|
||||
await sendgrid.sendMail(
|
||||
@ -243,7 +253,11 @@ export async function licenseAlertProcessing(
|
||||
// ライセンス失効警告メール
|
||||
if (targetAccount.userCountOfLicenseExpiringSoon !== 0) {
|
||||
const { subject, text, html } =
|
||||
await sendgrid.createMailContentOfLicenseExpiringSoon();
|
||||
await createMailContentOfLicenseExpiringSoon(
|
||||
targetAccount.companyName,
|
||||
targetAccount.userCountOfLicenseExpiringSoon,
|
||||
targetAccount.parentCompanyName
|
||||
);
|
||||
// メールを送信
|
||||
try {
|
||||
await sendgrid.sendMail(
|
||||
@ -267,7 +281,11 @@ export async function licenseAlertProcessing(
|
||||
// ライセンス不足メール
|
||||
if (targetAccount.shortage !== 0) {
|
||||
const { subject, text, html } =
|
||||
await sendgrid.createMailContentOfLicenseExpiringSoon();
|
||||
await createMailContentOfLicenseExpiringSoon(
|
||||
targetAccount.companyName,
|
||||
targetAccount.userCountOfLicenseExpiringSoon,
|
||||
targetAccount.parentCompanyName
|
||||
);
|
||||
// メールを送信
|
||||
try {
|
||||
await sendgrid.sendMail(
|
||||
|
||||
@ -0,0 +1,179 @@
|
||||
/**
|
||||
* メールコンテンツを作成する(ライセンス在庫不足)
|
||||
* @param companyName
|
||||
* @param shortage
|
||||
* @param dealer
|
||||
* @returns メールのサブジェクトとコンテンツ
|
||||
*/
|
||||
export async function createMailContentOfLicenseShortage(
|
||||
companyName: string,
|
||||
shortage: number,
|
||||
dealer: string | undefined
|
||||
): Promise<{
|
||||
subject: string;
|
||||
text: string;
|
||||
html: string;
|
||||
}> {
|
||||
return {
|
||||
// subject ////////////////////////////////////////////////////////////////////
|
||||
subject: "License Shortage Notification [U-103]",
|
||||
// text ////////////////////////////////////////////////////////////////////
|
||||
text: `<English>
|
||||
Dear ${companyName},
|
||||
|
||||
One or more of your assigned ODMS Cloud licenses will expire within 14 days. There is insufficient amount of unassigned licenses in your inventory to issue to users with expiring licenses.
|
||||
|
||||
Insufficient license count: ${shortage}
|
||||
|
||||
Please order additional annual licenses from ${dealer} to ensure you have sufficient inventory.
|
||||
|
||||
You can either automatically or manually assign licenses to users. Users with the Auto-assign option enabled (default) will have their license automatically assigned from your license inventory on the expiration date. If you disable the Auto-assign option, you must manually assign licenses.
|
||||
|
||||
Please log in to ODMS Cloud to configure your user setting and verify the license expiration date.
|
||||
URL: https://odmscloud.omsystem.com/
|
||||
|
||||
If you need support regarding ODMS Cloud, please contact ${dealer}.
|
||||
|
||||
If you have received this e-mail in error, please delete this e-mail from your system.
|
||||
This is an automatically generated e-mail and this mailbox is not monitored. Please do not reply.
|
||||
|
||||
|
||||
<Deutsch>
|
||||
Sehr geehrte(r) ${companyName},
|
||||
|
||||
Eine oder mehrere Ihrer zugewiesenen ODMS Cloud-Lizenzen laufen innerhalb von 14 Tagen ab. In Ihrem Bestand ist nicht genügend Anzahl nicht zugewiesener Lizenzen Inventar, um diese an Benutzer mit ablaufenden Lizenzen auszugeben.
|
||||
|
||||
Unzureichende Lizenzanzahl: ${shortage}
|
||||
|
||||
Bitte bestellen Sie zusätzliche Jahreslizenzen bei Ihrem ${dealer} um sicherzustellen, dass Sie über ausreichend Lagerbestände Inventar.
|
||||
|
||||
Sie können Benutzern entweder automatisch oder manuell Lizenzen zuweisen. Benutzern mit aktivierter Option „Automatische Zuweisung“ (Standard) wird die Lizenz am Ablaufdatum automatisch aus Ihrem Lizenzbestand zugewiesen. Wenn Sie die Option „Automatisch zuweisen“ deaktivieren, müssen Sie Lizenzen manuell zuweisen.
|
||||
|
||||
Bitte melden Sie sich bei ODMS Cloud an, um Ihre Benutzereinstellungen zu konfigurieren und das Ablaufdatum der Lizenz zu überprüfen.
|
||||
URL: https://odmscloud.omsystem.com/
|
||||
|
||||
Wenn Sie Unterstützung bezüglich ODMS benötigen, wenden Sie sich bitte an ${dealer}.
|
||||
|
||||
Wenn Sie diese E-Mail fälschlicherweise erhalten haben, löschen Sie diese E-Mail bitte aus Ihrem System.
|
||||
Dies ist eine automatisch generierte E-Mail und dieses Postfach wird nicht überwacht. Bitte nicht antworten.
|
||||
|
||||
|
||||
<Español>
|
||||
Estimado(a) ${companyName},
|
||||
|
||||
Una o más de sus licencias de ODMS Cloud asignadas caducarán en un plazo de 14 días. No hay una cantidad suficiente de licencias no asignadas en su inventario para emitirlas a usuarios con licencias vencidas.
|
||||
|
||||
Recuento de licencias insuficiente: ${shortage}
|
||||
|
||||
Solicite licencias anuales adicionales a su ${dealer} para asegurarse de tener suficiente inventario.
|
||||
|
||||
Puede asignar licencias a los usuarios de forma automática o manual. A los usuarios con la opción Asignación automática habilitada (predeterminada) se les asignará su licencia automáticamente desde su inventario de licencias en la fecha de vencimiento. Si desactiva la opción Asignar automáticamente, deberá asignar licencias manualmente.
|
||||
|
||||
Inicie sesión en ODMS Cloud para configurar su configuración de usuario y verificar la fecha de vencimiento de la licencia.
|
||||
URL: https://odmscloud.omsystem.com/
|
||||
|
||||
Si necesita ayuda con respecto a ODMS Cloud, comuníquese con ${dealer}.
|
||||
|
||||
Si recibió este correo electrónico por error, elimínelo de su sistema.
|
||||
Este es un correo electrónico generado automáticamente y este buzón no está monitoreado. Por favor, no responda.
|
||||
|
||||
|
||||
<Français>
|
||||
Chère/Cher ${companyName},
|
||||
|
||||
Une ou plusieurs de vos licences ODMS Cloud attribuées expireront dans les 14 jours. Le nombre de licences non attribuées dans votre inventaire est insuffisant pour être délivré aux utilisateurs dont les licences arrivent à expiration.
|
||||
|
||||
Nombre de licences insuffisant: ${shortage}
|
||||
|
||||
Veuillez commander des licences annuelles supplémentaires auprès de votre ${dealer} pour vous assurer que vous disposez d'un inventaire suffisant.
|
||||
|
||||
Vous pouvez attribuer automatiquement ou manuellement des licences aux utilisateurs. Les utilisateurs dont l'option d'attribution automatique est activée (par défaut) verront leur licence automatiquement attribuée à partir de votre inventaire de licences à la date d'expiration. Si vous désactivez l'option Attribution automatique, vous devez attribuer manuellement des licences.
|
||||
|
||||
Veuillez vous connecter à ODMS Cloud pour configurer vos paramètres utilisateur et vérifier la date d'expiration de la licence.
|
||||
URL: https://odmscloud.omsystem.com/
|
||||
|
||||
Si vous avez besoin d'assistance concernant ODMS Cloud, veuillez contacter ${dealer}.
|
||||
|
||||
Si vous avez reçu cet e-mail par erreur, veuillez supprimer cet e-mail de votre système.
|
||||
Il s'agit d'un e-mail généré automatiquement et cette boîte aux lettres n'est pas surveillée. Merci de ne pas répondre.`,
|
||||
// html ////////////////////////////////////////////////////////////////////
|
||||
html: `<h3><English></h3>
|
||||
<p>Dear ${companyName},<p>
|
||||
|
||||
<p>One or more of your assigned ODMS Cloud licenses will expire within 14 days. There is insufficient amount of unassigned licenses in your inventory to issue to users with expiring licenses.</p>
|
||||
|
||||
<p>Insufficient license count: ${shortage}</p>
|
||||
|
||||
<p>Please order additional annual licenses from ${dealer} to ensure you have sufficient inventory. </p>
|
||||
|
||||
<p>You can either automatically or manually assign licenses to users. Users with the Auto-assign option enabled (default) will have their license automatically assigned from your license inventory on the expiration date. If you disable the Auto-assign option, you must manually assign licenses.</p>
|
||||
|
||||
<p>Please log in to ODMS Cloud to configure your user setting and verify the license expiration date.<br>
|
||||
URL: <a href="https://odmscloud.omsystem.com/">https://odmscloud.omsystem.com/</a></p>
|
||||
|
||||
<p>If you need support regarding ODMS Cloud, please contact ${dealer}.</p>
|
||||
|
||||
<p>If you have received this e-mail in error, please delete this e-mail from your system.<br>
|
||||
This is an automatically generated e-mail and this mailbox is not monitored. Please do not reply.</p>
|
||||
|
||||
|
||||
<h3><Deutsch></h3>
|
||||
<p>Sehr geehrte(r) ${companyName},</p>
|
||||
|
||||
<p>Eine oder mehrere Ihrer zugewiesenen ODMS Cloud-Lizenzen laufen innerhalb von 14 Tagen ab. In Ihrem Bestand ist nicht genügend Anzahl nicht zugewiesener Lizenzen Inventar, um diese an Benutzer mit ablaufenden Lizenzen auszugeben.</p>
|
||||
|
||||
<p>Unzureichende Lizenzanzahl: ${shortage}</p>
|
||||
|
||||
<p>Bitte bestellen Sie zusätzliche Jahreslizenzen bei Ihrem ${dealer} um sicherzustellen, dass Sie über ausreichend Lagerbestände Inventar.</p>
|
||||
|
||||
<p>Sie können Benutzern entweder automatisch oder manuell Lizenzen zuweisen. Benutzern mit aktivierter Option „Automatische Zuweisung“ (Standard) wird die Lizenz am Ablaufdatum automatisch aus Ihrem Lizenzbestand zugewiesen. Wenn Sie die Option „Automatisch zuweisen“ deaktivieren, müssen Sie Lizenzen manuell zuweisen.</p>
|
||||
|
||||
<p>Bitte melden Sie sich bei ODMS Cloud an, um Ihre Benutzereinstellungen zu konfigurieren und das Ablaufdatum der Lizenz zu überprüfen.<br>
|
||||
URL: <a href="https://odmscloud.omsystem.com/">https://odmscloud.omsystem.com/</a></p>
|
||||
|
||||
<p>Wenn Sie Unterstützung bezüglich ODMS benötigen, wenden Sie sich bitte an ${dealer}.</p>
|
||||
|
||||
<p>Wenn Sie diese E-Mail fälschlicherweise erhalten haben, löschen Sie diese E-Mail bitte aus Ihrem System.<br>
|
||||
Dies ist eine automatisch generierte E-Mail und dieses Postfach wird nicht überwacht. Bitte nicht antworten.</p>
|
||||
|
||||
|
||||
<h3><Español></h3>
|
||||
<p>Estimado(a) ${companyName},</p>
|
||||
|
||||
<p>Una o más de sus licencias de ODMS Cloud asignadas caducarán en un plazo de 14 días. No hay una cantidad suficiente de licencias no asignadas en su inventario para emitirlas a usuarios con licencias vencidas.</p>
|
||||
|
||||
<p>Recuento de licencias insuficiente: ${shortage}</p>
|
||||
|
||||
<p>Solicite licencias anuales adicionales a su ${dealer} para asegurarse de tener suficiente inventario.</p>
|
||||
|
||||
<p>Puede asignar licencias a los usuarios de forma automática o manual. A los usuarios con la opción Asignación automática habilitada (predeterminada) se les asignará su licencia automáticamente desde su inventario de licencias en la fecha de vencimiento. Si desactiva la opción Asignar automáticamente, deberá asignar licencias manualmente.</p>
|
||||
|
||||
<p>Inicie sesión en ODMS Cloud para configurar su configuración de usuario y verificar la fecha de vencimiento de la licencia.<br>
|
||||
URL: <a href="https://odmscloud.omsystem.com/">https://odmscloud.omsystem.com/</a></p>
|
||||
|
||||
<p>Si necesita ayuda con respecto a ODMS Cloud, comuníquese con ${dealer}.</p>
|
||||
|
||||
<p>Si recibió este correo electrónico por error, elimínelo de su sistema.<br>
|
||||
Este es un correo electrónico generado automáticamente y este buzón no está monitoreado. Por favor, no responda.</p>
|
||||
|
||||
|
||||
<h3><Français></h3>
|
||||
<p>Chère/Cher ${companyName},</p>
|
||||
|
||||
<p>Une ou plusieurs de vos licences ODMS Cloud attribuées expireront dans les 14 jours. Le nombre de licences non attribuées dans votre inventaire est insuffisant pour être délivré aux utilisateurs dont les licences arrivent à expiration.</p>
|
||||
|
||||
<p>Nombre de licences insuffisant: ${shortage}</p>
|
||||
|
||||
<p>Veuillez commander des licences annuelles supplémentaires auprès de votre ${dealer} pour vous assurer que vous disposez d'un inventaire suffisant.</p>
|
||||
|
||||
<p>Vous pouvez attribuer automatiquement ou manuellement des licences aux utilisateurs. Les utilisateurs dont l'option d'attribution automatique est activée (par défaut) verront leur licence automatiquement attribuée à partir de votre inventaire de licences à la date d'expiration. Si vous désactivez l'option Attribution automatique, vous devez attribuer manuellement des licences.</p>
|
||||
|
||||
<p>Veuillez vous connecter à ODMS Cloud pour configurer vos paramètres utilisateur et vérifier la date d'expiration de la licence.<br>
|
||||
URL: <a href="https://odmscloud.omsystem.com/">https://odmscloud.omsystem.com/</a></p>
|
||||
|
||||
<p>Si vous avez besoin d'assistance concernant ODMS Cloud, veuillez contacter ${dealer}.</p>
|
||||
|
||||
<p>Si vous avez reçu cet e-mail par erreur, veuillez supprimer cet e-mail de votre système.<br>
|
||||
Il s'agit d'un e-mail généré automatiquement et cette boîte aux lettres n'est pas surveillée. Merci de ne pas répondre.</p>`,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,156 @@
|
||||
/**
|
||||
* メールコンテンツを作成する(ライセンス失効警告)
|
||||
* @param companyName
|
||||
* @param ExpiringSoonUserCount
|
||||
* @param dealer
|
||||
* @returns メールのサブジェクトとコンテンツ
|
||||
*/
|
||||
export async function createMailContentOfLicenseExpiringSoon(
|
||||
companyName: string,
|
||||
ExpiringSoonUserCount: number,
|
||||
dealer: string | undefined
|
||||
): Promise<{
|
||||
subject: string;
|
||||
text: string;
|
||||
html: string;
|
||||
}> {
|
||||
return {
|
||||
// subject ////////////////////////////////////////////////////////////////////
|
||||
subject: "License Expiration Warning [U-104]",
|
||||
// text ////////////////////////////////////////////////////////////////////
|
||||
text: `<English>
|
||||
Dear ${companyName},
|
||||
|
||||
One or more of your assigned ODMS Cloud licenses will expire today.
|
||||
Number of licenses expiring: ${ExpiringSoonUserCount}
|
||||
|
||||
If you do not have a sufficient number of licenses, you will need to order annual licenses from your ${dealer} and assign them to your users whose licenses are expiring.
|
||||
|
||||
Please log in to ODMS Cloud to configure your user setting and verify the license expiration date.
|
||||
URL: https://odmscloud.omsystem.com/
|
||||
|
||||
If you need support regarding ODMS Cloud, please contact ${dealer}.
|
||||
|
||||
If you have received this e-mail in error, please delete this e-mail from your system.
|
||||
This is an automatically generated e-mail and this mailbox is not monitored. Please do not reply.
|
||||
|
||||
|
||||
<Deutsch>
|
||||
Sehr geehrte(r) ${companyName},
|
||||
|
||||
Eine oder mehrere Ihrer zugewiesenen ODMS Cloud-Lizenzen laufen heute ab.
|
||||
Anzahl der auslaufenden Lizenzen: ${ExpiringSoonUserCount}
|
||||
|
||||
Wenn Sie nicht über genügend Lizenzen verfügen, müssen Sie Jahreslizenzen bei Ihrem ${dealer} bestellen und diese Ihren Benutzern zuweisen, deren Lizenzen ablaufen.
|
||||
|
||||
Bitte melden Sie sich bei ODMS Cloud an, um Ihre Benutzereinstellungen zu konfigurieren und das Ablaufdatum der Lizenz zu überprüfen.
|
||||
URL: https://odmscloud.omsystem.com/
|
||||
|
||||
Wenn Sie Unterstützung bezüglich ODMS benötigen, wenden Sie sich bitte an ${dealer}.
|
||||
|
||||
Wenn Sie diese E-Mail fälschlicherweise erhalten haben, löschen Sie diese E-Mail bitte aus Ihrem System.
|
||||
Dies ist eine automatisch generierte E-Mail und dieses Postfach wird nicht überwacht. Bitte nicht antworten.
|
||||
|
||||
|
||||
<Español>
|
||||
Estimado(a) ${companyName},
|
||||
|
||||
Una o más de sus licencias de ODMS Cloud asignadas caducarán hoy.
|
||||
Número de licencias que vencen: ${ExpiringSoonUserCount}
|
||||
|
||||
Si no tiene una cantidad suficiente de licencias, deberá solicitar licencias anuales a su ${dealer} y asignarlas a los usuarios cuyas licencias están por vencer.
|
||||
|
||||
Inicie sesión en ODMS Cloud para configurar su configuración de usuario y verificar la fecha de vencimiento de la licencia.
|
||||
URL: https://odmscloud.omsystem.com/
|
||||
|
||||
Si necesita ayuda con respecto a ODMS Cloud, comuníquese con ${dealer}.
|
||||
|
||||
Si recibió este correo electrónico por error, elimínelo de su sistema.
|
||||
Este es un correo electrónico generado automáticamente y este buzón no está monitoreado. Por favor, no responda.
|
||||
|
||||
|
||||
<Français>
|
||||
Chère/Cher ${companyName},
|
||||
|
||||
Une ou plusieurs de vos licences ODMS Cloud attribuées expireront aujourd'hui.
|
||||
Nombre de licences arrivant à expiration: ${ExpiringSoonUserCount}
|
||||
|
||||
Si vous ne disposez pas d'un nombre suffisant de licences, vous devrez commander des licences annuelles auprès de votre ${dealer} et les attribuer à vos utilisateurs dont les licences arrivent à expiration.
|
||||
|
||||
Veuillez vous connecter à ODMS Cloud pour configurer vos paramètres utilisateur et vérifier la date d'expiration de la licence.
|
||||
URL: https://odmscloud.omsystem.com/
|
||||
|
||||
Si vous avez besoin d'assistance concernant ODMS Cloud, veuillez contacter ${dealer}.
|
||||
|
||||
Si vous avez reçu cet e-mail par erreur, veuillez supprimer cet e-mail de votre système.
|
||||
Il s'agit d'un e-mail généré automatiquement et cette boîte aux lettres n'est pas surveillée. Merci de ne pas répondre.`,
|
||||
// html ////////////////////////////////////////////////////////////////////
|
||||
html: `<h3><English></h3>
|
||||
<p>Dear ${companyName},</p>
|
||||
|
||||
<p>One or more of your assigned ODMS Cloud licenses will expire today.<br>
|
||||
Number of licenses expiring: ${ExpiringSoonUserCount}</p>
|
||||
|
||||
<p>If you do not have a sufficient number of licenses, you will need to order annual licenses from your ${dealer} and assign them to your users whose licenses are expiring.</p>
|
||||
|
||||
<p>Please log in to ODMS Cloud to configure your user setting and verify the license expiration date.<br>
|
||||
URL: <a href="https://odmscloud.omsystem.com/">https://odmscloud.omsystem.com/</a></p>
|
||||
|
||||
<p>If you need support regarding ODMS Cloud, please contact ${dealer}.</p>
|
||||
|
||||
<p>If you have received this e-mail in error, please delete this e-mail from your system.<br>
|
||||
This is an automatically generated e-mail and this mailbox is not monitored. Please do not reply.</p>
|
||||
|
||||
|
||||
<h3><Deutsch></h3>
|
||||
<p>Sehr geehrte(r) ${companyName},</p>
|
||||
|
||||
<p>Eine oder mehrere Ihrer zugewiesenen ODMS Cloud-Lizenzen laufen heute ab.<br>
|
||||
Anzahl der auslaufenden Lizenzen: ${ExpiringSoonUserCount}</p>
|
||||
|
||||
<p>Wenn Sie nicht über genügend Lizenzen verfügen, müssen Sie Jahreslizenzen bei Ihrem ${dealer} bestellen und diese Ihren Benutzern zuweisen, deren Lizenzen ablaufen.</p>
|
||||
|
||||
<p>Bitte melden Sie sich bei ODMS Cloud an, um Ihre Benutzereinstellungen zu konfigurieren und das Ablaufdatum der Lizenz zu überprüfen.<br>
|
||||
URL: <a href="https://odmscloud.omsystem.com/">https://odmscloud.omsystem.com/</a></p>
|
||||
|
||||
<p>Wenn Sie Unterstützung bezüglich ODMS benötigen, wenden Sie sich bitte an ${dealer}.</p>
|
||||
|
||||
<p>Wenn Sie diese E-Mail fälschlicherweise erhalten haben, löschen Sie diese E-Mail bitte aus Ihrem System.<br>
|
||||
Dies ist eine automatisch generierte E-Mail und dieses Postfach wird nicht überwacht. Bitte nicht antworten.</p>
|
||||
|
||||
|
||||
<h3><Español></h3>
|
||||
<p>Estimado(a) ${companyName},</p>
|
||||
|
||||
<p>Una o más de sus licencias de ODMS Cloud asignadas caducarán hoy.<br>
|
||||
Número de licencias que vencen: ${ExpiringSoonUserCount}</p>
|
||||
|
||||
<p>Si no tiene una cantidad suficiente de licencias, deberá solicitar licencias anuales a su ${dealer} y asignarlas a los usuarios cuyas licencias están por vencer.</p>
|
||||
|
||||
<p>Inicie sesión en ODMS Cloud para configurar su configuración de usuario y verificar la fecha de vencimiento de la licencia.<br>
|
||||
URL: <a href="https://odmscloud.omsystem.com/">https://odmscloud.omsystem.com/</a></p>
|
||||
|
||||
<p>Si necesita ayuda con respecto a ODMS Cloud, comuníquese con ${dealer}.</p>
|
||||
|
||||
<p>Si recibió este correo electrónico por error, elimínelo de su sistema.<br>
|
||||
Este es un correo electrónico generado automáticamente y este buzón no está monitoreado. Por favor, no responda.</p>
|
||||
|
||||
|
||||
<h3><Français></h3>
|
||||
<p>Chère/Cher ${companyName},</p>
|
||||
|
||||
<p>Une ou plusieurs de vos licences ODMS Cloud attribuées expireront aujourd'hui.<br>
|
||||
Nombre de licences arrivant à expiration: ${ExpiringSoonUserCount}</p>
|
||||
|
||||
<p>Si vous ne disposez pas d'un nombre suffisant de licences, vous devrez commander des licences annuelles auprès de votre ${dealer} et les attribuer à vos utilisateurs dont les licences arrivent à expiration.</p>
|
||||
|
||||
<p>Veuillez vous connecter à ODMS Cloud pour configurer vos paramètres utilisateur et vérifier la date d'expiration de la licence.<br>
|
||||
URL: <a href="https://odmscloud.omsystem.com/">https://odmscloud.omsystem.com/</a></p>
|
||||
|
||||
<p>Si vous avez besoin d'assistance concernant ODMS Cloud, veuillez contacter ${dealer}.</p>
|
||||
|
||||
<p>Si vous avez reçu cet e-mail par erreur, veuillez supprimer cet e-mail de votre système.<br>
|
||||
Il s'agit d'un e-mail généré automatiquement et cette boîte aux lettres n'est pas surveillée. Merci de ne pas répondre.</p>
|
||||
`,
|
||||
};
|
||||
}
|
||||
@ -8,43 +8,6 @@ export class SendGridService {
|
||||
}
|
||||
sendgrid.setApiKey(process.env.SENDGRID_API_KEY);
|
||||
}
|
||||
/**
|
||||
* メールコンテンツを作成する(ライセンス不足)
|
||||
* @param accountId 認証対象のユーザーが所属するアカウントのID
|
||||
* @param userId 認証対象のユーザーのID
|
||||
* @param email 認証対象のユーザーのメールアドレス
|
||||
* @returns メールのサブジェクトとコンテンツ
|
||||
*/
|
||||
async createMailContentOfLicenseShortage(): Promise<{
|
||||
subject: string;
|
||||
text: string;
|
||||
html: string;
|
||||
}> {
|
||||
return {
|
||||
subject: "ライセンス在庫不足通知",
|
||||
text: `ライセンス在庫不足通知:本文`,
|
||||
html: `<p>ライセンス在庫不足通知:本文</p>`,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* メールコンテンツを作成する(ライセンス不足)
|
||||
* @param accountId 認証対象のユーザーが所属するアカウントのID
|
||||
* @param userId 認証対象のユーザーのID
|
||||
* @param email 認証対象のユーザーのメールアドレス
|
||||
* @returns メールのサブジェクトとコンテンツ
|
||||
*/
|
||||
async createMailContentOfLicenseExpiringSoon(): Promise<{
|
||||
subject: string;
|
||||
text: string;
|
||||
html: string;
|
||||
}> {
|
||||
return {
|
||||
subject: "ライセンス失効警告 ",
|
||||
text: `ライセンス失効警告:本文`,
|
||||
html: `<p>ライセンス失効警告:本文</p>`,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* メールを送信する
|
||||
|
||||
@ -41,14 +41,6 @@ describe("licenseAlert", () => {
|
||||
const sendgridMock = new SendGridServiceMock() as SendGridService;
|
||||
const adb2cMock = new AdB2cServiceMock() as AdB2cService;
|
||||
// 呼び出し回数でテスト成否を判定
|
||||
const spyShortage = jest.spyOn(
|
||||
sendgridMock,
|
||||
"createMailContentOfLicenseShortage"
|
||||
);
|
||||
const spyExpirySoon = jest.spyOn(
|
||||
sendgridMock,
|
||||
"createMailContentOfLicenseExpiringSoon"
|
||||
);
|
||||
const spySend = jest.spyOn(sendgridMock, "sendMail");
|
||||
|
||||
const currentDate = new DateWithZeroTime();
|
||||
@ -72,8 +64,6 @@ describe("licenseAlert", () => {
|
||||
);
|
||||
|
||||
await licenseAlertProcessing(context, source, sendgridMock, adb2cMock);
|
||||
expect(spyShortage.mock.calls).toHaveLength(1);
|
||||
expect(spyExpirySoon.mock.calls).toHaveLength(0);
|
||||
expect(spySend.mock.calls).toHaveLength(1);
|
||||
});
|
||||
|
||||
@ -84,14 +74,6 @@ describe("licenseAlert", () => {
|
||||
const adb2cMock = new AdB2cServiceMock() as AdB2cService;
|
||||
|
||||
// 呼び出し回数でテスト成否を判定
|
||||
const spyShortage = jest.spyOn(
|
||||
sendgridMock,
|
||||
"createMailContentOfLicenseShortage"
|
||||
);
|
||||
const spyExpirySoon = jest.spyOn(
|
||||
sendgridMock,
|
||||
"createMailContentOfLicenseExpiringSoon"
|
||||
);
|
||||
const spySend = jest.spyOn(sendgridMock, "sendMail");
|
||||
|
||||
const currentDate = new DateWithZeroTime();
|
||||
@ -115,8 +97,6 @@ describe("licenseAlert", () => {
|
||||
);
|
||||
|
||||
await licenseAlertProcessing(context, source, sendgridMock, adb2cMock);
|
||||
expect(spyShortage.mock.calls).toHaveLength(1);
|
||||
expect(spyExpirySoon.mock.calls).toHaveLength(1);
|
||||
expect(spySend.mock.calls).toHaveLength(2);
|
||||
});
|
||||
|
||||
@ -127,14 +107,6 @@ describe("licenseAlert", () => {
|
||||
const adb2cMock = new AdB2cServiceMock() as AdB2cService;
|
||||
|
||||
// 呼び出し回数でテスト成否を判定
|
||||
const spyShortage = jest.spyOn(
|
||||
sendgridMock,
|
||||
"createMailContentOfLicenseShortage"
|
||||
);
|
||||
const spyExpirySoon = jest.spyOn(
|
||||
sendgridMock,
|
||||
"createMailContentOfLicenseExpiringSoon"
|
||||
);
|
||||
const spySend = jest.spyOn(sendgridMock, "sendMail");
|
||||
|
||||
const currentDate = new DateWithZeroTime();
|
||||
@ -171,8 +143,6 @@ describe("licenseAlert", () => {
|
||||
);
|
||||
|
||||
await licenseAlertProcessing(context, source, sendgridMock, adb2cMock);
|
||||
expect(spyShortage.mock.calls).toHaveLength(0);
|
||||
expect(spyExpirySoon.mock.calls).toHaveLength(0);
|
||||
expect(spySend.mock.calls).toHaveLength(0);
|
||||
});
|
||||
|
||||
@ -183,14 +153,6 @@ describe("licenseAlert", () => {
|
||||
const adb2cMock = new AdB2cServiceMock() as AdB2cService;
|
||||
|
||||
// 呼び出し回数でテスト成否を判定
|
||||
const spyShortage = jest.spyOn(
|
||||
sendgridMock,
|
||||
"createMailContentOfLicenseShortage"
|
||||
);
|
||||
const spyExpirySoon = jest.spyOn(
|
||||
sendgridMock,
|
||||
"createMailContentOfLicenseExpiringSoon"
|
||||
);
|
||||
const spySend = jest.spyOn(sendgridMock, "sendMail");
|
||||
|
||||
const currentDate = new DateWithZeroTime();
|
||||
@ -214,52 +176,12 @@ describe("licenseAlert", () => {
|
||||
);
|
||||
|
||||
await licenseAlertProcessing(context, source, sendgridMock, adb2cMock);
|
||||
expect(spyShortage.mock.calls).toHaveLength(1);
|
||||
expect(spyExpirySoon.mock.calls).toHaveLength(0);
|
||||
expect(spySend.mock.calls).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
// テスト用sendgrid
|
||||
export class SendGridServiceMock {
|
||||
/**
|
||||
* メールコンテンツを作成する(ライセンス不足)
|
||||
* @param accountId 認証対象のユーザーが所属するアカウントのID
|
||||
* @param userId 認証対象のユーザーのID
|
||||
* @param email 認証対象のユーザーのメールアドレス
|
||||
* @returns メールのサブジェクトとコンテンツ
|
||||
*/
|
||||
async createMailContentOfLicenseShortage(): Promise<{
|
||||
subject: string;
|
||||
text: string;
|
||||
html: string;
|
||||
}> {
|
||||
return {
|
||||
subject: "ライセンス在庫不足通知",
|
||||
text: `ライセンス在庫不足通知:本文`,
|
||||
html: `<p>ライセンス在庫不足通知:本文</p>`,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* メールコンテンツを作成する(ライセンス不足)
|
||||
* @param accountId 認証対象のユーザーが所属するアカウントのID
|
||||
* @param userId 認証対象のユーザーのID
|
||||
* @param email 認証対象のユーザーのメールアドレス
|
||||
* @returns メールのサブジェクトとコンテンツ
|
||||
*/
|
||||
async createMailContentOfLicenseExpiringSoon(): Promise<{
|
||||
subject: string;
|
||||
text: string;
|
||||
html: string;
|
||||
}> {
|
||||
return {
|
||||
subject: "ライセンス失効警告",
|
||||
text: `ライセンス失効警告:本文`,
|
||||
html: `<p>ライセンス失効警告:本文</p>`,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* メールを送信する
|
||||
* @param to
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user