{"value":"Organizations with global operations can struggle to notify their customers of any business-related announcements or notifications in different languages. Their customers want to receive notifications in their local language and communication preference. Organizations often rely on complicated third-party services or individuals to manually translate the notifications. This can lead to a loss of revenue due to delayed communication and additional operational expenses.\n\nThis blog post demonstrates how to build a straightforward, cost-effective, and scalable multi-language notification system using [Amazon Web Services Serverless](https://aws.amazon.com/serverless/) technologies. You can post a business-related announcement or notification in English, and based on the customer profile data, it will convert this announcement or notification into different languages. Additionally, the system will also deliver these translated announcements or notifications as an email, voice, or SMS.\n\n#### **Example of a multi-language notification use case**\nA restaurant franchise company is adding a new item to their menu and plans to release it in North America, Germany, and France. The corporate office has decided to send the following notification.\n\n*The company is adding a new item to the menu, and this will go live by May 10. Please ensure you are prepared for this change and plan accordingly.*\n\nThe franchise owners in Germany want to receive the notifications in the German language, whereas the franchise owners in France want to receive it in French. North American franchises want to receive it in English.\n\n#### **Solution design for multi-language notification system**\nThe solution in Figure 1 demonstrates how to build a multi-language notification system using [ Amazon Translate ](https://aws.amazon.com/translate/) and [Amazon Pinpoint](https://aws.amazon.com/pinpoint/).\n\nAmazon Web Services Serverless technologies handle automatic scaling, have built-in high availability architecture, and a pay-for-use billing model, which increases agility and optimizes costs. The system built with this solution is invoked using [REST API endpoints](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-rest-api.html). Once this solution is deployed, it can be integrated with any frontend application where users can log in and send out notification events.\n\nFigure 1 illustrates the architecture of this solution.\n\n![image.png](https://dev-media.amazoncloud.cn/e247ba9c85734f3ebb1c80bf778152b8_image.png)\n\nFigure 1. Solution architecture for multi-language notification system\n\n1. The restaurant franchise will log in to their UI to type the notification message in English. Upon submission, the notification message is sent to the[ Amazon API Gateway ](https://aws.amazon.com/api-gateway/)REST endpoint.\n**Note**: In this solution, there is no UI available. You will use a terminal to submit the message.\n\n2. [Amazon API Gateway](https://aws.amazon.com/cn/api-gateway/?trk=cndc-detail) will send this message to [Amazon Simple Queue Service (SQS),](https://aws.amazon.com/sqs/), which will keep the HTTP requests asynchronous.\n\n3. The SQS queue will invoke the SQS [ Amazon Web Services Lambda](https://aws.amazon.com/lambda/) function.\n\n4. The SQS Lambda function invokes the [ Amazon Web Services Step Functions](https://aws.amazon.com/step-functions/) state machine. This SQS Lambda function is used as a proxy mechanism to start the state machine workflow. Amazon Web Services Step Functions are used to orchestrate the notification workflow process. The workflow process validates the message, converts it into different languages, and notifies the customers in their preferred way of communication (email, voice, or SMS). It also handles errors if any of the steps fail by using [ SQS dead-letter queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html)\n\n5. The message entered must be validated in order to ensure that the organizational standards are followed. To perform the message validation, we use the [Amazon Comprehend](https://aws.amazon.com/comprehend/) service. Comprehend’s Sentiment analysis will determine whether to send or flag the message. All flagged messages are sent for review.\n\t - In the example use case message preceding, the message sentiment neutral score is 0.85 confidence. If you set the acceptable score to anything greater than 0.5 confidence, then it is a valid message. Once it passes the validation step, the workflow will proceed to the next step.\n\t- If the message is vague or not clear, the sentiment score might be less than 0.5 confidence. For example, if this is the message used: We are adding a dish; be ready for it, the sentiment score might be only 0.45 confidence. This is under the acceptable score, and the message will not be processed further.\n\t\n6. After the message is successfully validated, the message is translated into various languages depending on the customers’ profiles. The Translate Lambda function determines the number of unique languages by referring to the customer profile data in the[Amazon DynamoDB](https://aws.amazon.com/dynamodb/) table. The function then uses [Amazon Translate](https://aws.amazon.com/cn/translate/?trk=cndc-detail) to translate the message to the different languages required for that notification event. In our example use case, the converted messages will look as follows:\n- \t**German (de):**\n\t\tDas Unternehmen fügt dem Menü einen neuen Punkt hinzu, der bis zum 10. Mai live geschaltet wird. Bitte stellen Sie sicher, dass Sie auf diese Änderung vorbereitet sind und planen Sie entsprechend.- \n- **French (fr):**\n\t\t La société ajoute un nouvel article au menu, qui sera mis en ligne d’ici le 10 mai. Assurez-vous d’être prêt pour ce changement et de planifier en conséquence.\n7. The last step in the workflow is to build the notification logic and deliver the notifications. The [Amazon Pinpoint](https://aws.amazon.com/cn/pinpoint/?trk=cndc-detail) Lambda function retrieves the customer’s profile from the [Amazon DynamoDB](https://aws.amazon.com/cn/dynamodb/?trk=cndc-detail) table. It then parses each record for a given notification event to find out the delivery mode (email, voice, or SMS message). The function then builds the notification logic using [Amazon Pinpoint](https://aws.amazon.com/cn/pinpoint/?trk=cndc-detail). [Amazon Pinpoint](https://aws.amazon.com/cn/pinpoint/?trk=cndc-detail) notifies each customer either by email, voice, or SMS.\n\n#### **Code repository**\nThe code for this solution is available on [GitHub](https://github.com/aws-samples/multi-language-notification-with-amazon-translate-amazon-pinpoint). Review the README file for detailed instructions on how to download and run the solution in your Amazon Web Services account.\n\n#### **Conclusion**\nOrganizations that operate on an international basis often struggle to build a multi-language notification system to communicate any business-related announcements or notifications to their customers in different languages. Communicating these announcements or notifications in a variety of formats such as email, voice, and SMS can be time-consuming. Our solution addresses these challenges using Amazon Web Services services with fewer steps than traditional third-party options. This solution also features automatic scaling, built-in high availability, and a pay-for-use billing model to increase agility and optimize costs. These technologies not only decrease infrastructure management tasks like capacity provisioning and patching, but provides for a better customer experience.\n\n**Further reading:**\n\n- [Building a serverless image catalog with Amazon Web Services Step Functions Workflow Studio](https://aws.amazon.com/blogs/compute/building-a-serverless-image-catalog-with-aws-step-functions-workflow-studio/)\n- -[Two-way translation, using Amazon Connect and Amazon Translate](https://aws.amazon.com/blogs/machine-learning/implement-live-customer-service-chat-with-two-way-translation-using-amazon-connect-and-amazon-translate/)\n- -[Building multilingual SMS chatbot campaigns](https://aws.amazon.com/blogs/industries/building-multilingual-sms-chatbot-campaigns-to-support-covid-19-patients-remotely/)\n\n![image.png](https://dev-media.amazoncloud.cn/28e95acf919443978382ecc421140a9a_image.png)\t\n\n**Praveen Allam**\nPraveen Allam is a Solutions Architect at Amazon Web Services. He helps customers in designing scalable, high-performance, and cost effective enterprise grade applications using the Amazon Web Services Cloud. He builds solutions to help organizations make data-driven decisions.\n\n![image.png](https://dev-media.amazoncloud.cn/c57013ccc6104537b96c459ac3c6b9ae_image.png)\n\n**Steven Warwick**\nSteven Warwick is a Solutions Architect at Amazon Web Services. He is an engineer at heart with a passion for creating simple solutions to complex problems. He has a background in real time analytics and a passion for SaaS implementations. In his free time, he plays badminton and tinkers with IoT projects around the house.\n\n![image.png](https://dev-media.amazoncloud.cn/1fddbddc7a4a4f8493c92f27b0c90f47_image.png)\n\n**Srilatha Kola**\nSri is a Technical Training Specialist in the Amazon Web Services T&C organization for the Serverless domain. Sri develops technical and non-technical training content for customers. Prior to joining Amazon Web Services, Sri worked in different technical roles specializing in automation and web development.","render":"<p>Organizations with global operations can struggle to notify their customers of any business-related announcements or notifications in different languages. Their customers want to receive notifications in their local language and communication preference. Organizations often rely on complicated third-party services or individuals to manually translate the notifications. This can lead to a loss of revenue due to delayed communication and additional operational expenses.</p>\n<p>This blog post demonstrates how to build a straightforward, cost-effective, and scalable multi-language notification system using <a href=\\"https://aws.amazon.com/serverless/\\" target=\\"_blank\\">Amazon Web Services Serverless</a> technologies. You can post a business-related announcement or notification in English, and based on the customer profile data, it will convert this announcement or notification into different languages. Additionally, the system will also deliver these translated announcements or notifications as an email, voice, or SMS.</p>\\n<h4><a id=\\"Example_of_a_multilanguage_notification_use_case_4\\"></a><strong>Example of a multi-language notification use case</strong></h4>\\n<p>A restaurant franchise company is adding a new item to their menu and plans to release it in North America, Germany, and France. The corporate office has decided to send the following notification.</p>\n<p><em>The company is adding a new item to the menu, and this will go live by May 10. Please ensure you are prepared for this change and plan accordingly.</em></p>\\n<p>The franchise owners in Germany want to receive the notifications in the German language, whereas the franchise owners in France want to receive it in French. North American franchises want to receive it in English.</p>\n<h4><a id=\\"Solution_design_for_multilanguage_notification_system_11\\"></a><strong>Solution design for multi-language notification system</strong></h4>\\n<p>The solution in Figure 1 demonstrates how to build a multi-language notification system using <a href=\\"https://aws.amazon.com/translate/\\" target=\\"_blank\\"> Amazon Translate </a> and <a href=\\"https://aws.amazon.com/pinpoint/\\" target=\\"_blank\\">Amazon Pinpoint</a>.</p>\\n<p>Amazon Web Services Serverless technologies handle automatic scaling, have built-in high availability architecture, and a pay-for-use billing model, which increases agility and optimizes costs. The system built with this solution is invoked using <a href=\\"https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-rest-api.html\\" target=\\"_blank\\">REST API endpoints</a>. Once this solution is deployed, it can be integrated with any frontend application where users can log in and send out notification events.</p>\\n<p>Figure 1 illustrates the architecture of this solution.</p>\n<p><img src=\\"https://dev-media.amazoncloud.cn/e247ba9c85734f3ebb1c80bf778152b8_image.png\\" alt=\\"image.png\\" /></p>\n<p>Figure 1. Solution architecture for multi-language notification system</p>\n<ol>\\n<li>\\n<p>The restaurant franchise will log in to their UI to type the notification message in English. Upon submission, the notification message is sent to the<a href=\\"https://aws.amazon.com/api-gateway/\\" target=\\"_blank\\"> Amazon API Gateway </a>REST endpoint.<br />\\n<strong>Note</strong>: In this solution, there is no UI available. You will use a terminal to submit the message.</p>\\n</li>\n<li>\\n<p>Amazon API Gateway will send this message to <a href=\\"https://aws.amazon.com/sqs/\\" target=\\"_blank\\">Amazon Simple Queue Service (SQS),</a>, which will keep the HTTP requests asynchronous.</p>\\n</li>\n<li>\\n<p>The SQS queue will invoke the SQS <a href=\\"https://aws.amazon.com/lambda/\\" target=\\"_blank\\"> Amazon Web Services Lambda</a> function.</p>\\n</li>\n<li>\\n<p>The SQS Lambda function invokes the <a href=\\"https://aws.amazon.com/step-functions/\\" target=\\"_blank\\"> Amazon Web Services Step Functions</a> state machine. This SQS Lambda function is used as a proxy mechanism to start the state machine workflow. Amazon Web Services Step Functions are used to orchestrate the notification workflow process. The workflow process validates the message, converts it into different languages, and notifies the customers in their preferred way of communication (email, voice, or SMS). It also handles errors if any of the steps fail by using <a href=\\"https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html\\" target=\\"_blank\\"> SQS dead-letter queue</a></p>\\n</li>\n<li>\\n<p>The message entered must be validated in order to ensure that the organizational standards are followed. To perform the message validation, we use the <a href=\\"https://aws.amazon.com/comprehend/\\" target=\\"_blank\\">Amazon Comprehend</a> service. Comprehend’s Sentiment analysis will determine whether to send or flag the message. All flagged messages are sent for review.</p>\\n<ul>\\n<li>In the example use case message preceding, the message sentiment neutral score is 0.85 confidence. If you set the acceptable score to anything greater than 0.5 confidence, then it is a valid message. Once it passes the validation step, the workflow will proceed to the next step.</li>\n<li>If the message is vague or not clear, the sentiment score might be less than 0.5 confidence. For example, if this is the message used: We are adding a dish; be ready for it, the sentiment score might be only 0.45 confidence. This is under the acceptable score, and the message will not be processed further.</li>\n</ul>\\n</li>\n<li>\\n<p>After the message is successfully validated, the message is translated into various languages depending on the customers’ profiles. The Translate Lambda function determines the number of unique languages by referring to the customer profile data in the<a href=\\"https://aws.amazon.com/dynamodb/\\" target=\\"_blank\\">Amazon DynamoDB</a> table. The function then uses [Amazon Translate](https://aws.amazon.com/cn/translate/?trk=cndc-detail) to translate the message to the different languages required for that notification event. In our example use case, the converted messages will look as follows:</p>\\n</li>\n</ol>\\n<ul>\\n<li><strong>German (de):</strong><br />\\nDas Unternehmen fügt dem Menü einen neuen Punkt hinzu, der bis zum 10. Mai live geschaltet wird. Bitte stellen Sie sicher, dass Sie auf diese Änderung vorbereitet sind und planen Sie entsprechend.-</li>\n<li><strong>French (fr):</strong><br />\\nLa société ajoute un nouvel article au menu, qui sera mis en ligne d’ici le 10 mai. Assurez-vous d’être prêt pour ce changement et de planifier en conséquence.</li>\n</ul>\\n<ol start=\\"7\\">\\n<li>The last step in the workflow is to build the notification logic and deliver the notifications. The Amazon Pinpoint Lambda function retrieves the customer’s profile from the Amazon DynamoDB table. It then parses each record for a given notification event to find out the delivery mode (email, voice, or SMS message). The function then builds the notification logic using Amazon Pinpoint. Amazon Pinpoint notifies each customer either by email, voice, or SMS.</li>\n</ol>\\n<h4><a id=\\"Code_repository_42\\"></a><strong>Code repository</strong></h4>\\n<p>The code for this solution is available on <a href=\\"https://github.com/aws-samples/multi-language-notification-with-amazon-translate-amazon-pinpoint\\" target=\\"_blank\\">GitHub</a>. Review the README file for detailed instructions on how to download and run the solution in your Amazon Web Services account.</p>\\n<h4><a id=\\"Conclusion_45\\"></a><strong>Conclusion</strong></h4>\\n<p>Organizations that operate on an international basis often struggle to build a multi-language notification system to communicate any business-related announcements or notifications to their customers in different languages. Communicating these announcements or notifications in a variety of formats such as email, voice, and SMS can be time-consuming. Our solution addresses these challenges using Amazon Web Services services with fewer steps than traditional third-party options. This solution also features automatic scaling, built-in high availability, and a pay-for-use billing model to increase agility and optimize costs. These technologies not only decrease infrastructure management tasks like capacity provisioning and patching, but provides for a better customer experience.</p>\n<p><strong>Further reading:</strong></p>\\n<ul>\\n<li><a href=\\"https://aws.amazon.com/blogs/compute/building-a-serverless-image-catalog-with-aws-step-functions-workflow-studio/\\" target=\\"_blank\\">Building a serverless image catalog with Amazon Web Services Step Functions Workflow Studio</a></li>\\n<li>-<a href=\\"https://aws.amazon.com/blogs/machine-learning/implement-live-customer-service-chat-with-two-way-translation-using-amazon-connect-and-amazon-translate/\\" target=\\"_blank\\">Two-way translation, using Amazon Connect and Amazon Translate</a></li>\\n<li>-<a href=\\"https://aws.amazon.com/blogs/industries/building-multilingual-sms-chatbot-campaigns-to-support-covid-19-patients-remotely/\\" target=\\"_blank\\">Building multilingual SMS chatbot campaigns</a></li>\\n</ul>\n<p><img src=\\"https://dev-media.amazoncloud.cn/28e95acf919443978382ecc421140a9a_image.png\\" alt=\\"image.png\\" /></p>\n<p><strong>Praveen Allam</strong><br />\\nPraveen Allam is a Solutions Architect at Amazon Web Services. He helps customers in designing scalable, high-performance, and cost effective enterprise grade applications using the Amazon Web Services Cloud. He builds solutions to help organizations make data-driven decisions.</p>\n<p><img src=\\"https://dev-media.amazoncloud.cn/c57013ccc6104537b96c459ac3c6b9ae_image.png\\" alt=\\"image.png\\" /></p>\n<p><strong>Steven Warwick</strong><br />\\nSteven Warwick is a Solutions Architect at Amazon Web Services. He is an engineer at heart with a passion for creating simple solutions to complex problems. He has a background in real time analytics and a passion for SaaS implementations. In his free time, he plays badminton and tinkers with IoT projects around the house.</p>\n<p><img src=\\"https://dev-media.amazoncloud.cn/1fddbddc7a4a4f8493c92f27b0c90f47_image.png\\" alt=\\"image.png\\" /></p>\n<p><strong>Srilatha Kola</strong><br />\\nSri is a Technical Training Specialist in the Amazon Web Services T&C organization for the Serverless domain. Sri develops technical and non-technical training content for customers. Prior to joining Amazon Web Services, Sri worked in different technical roles specializing in automation and web development.</p>\n"}