How is the content of the user notification hub generated?

Source: Internet
Author: User

The question is not how the message pushes this piece, but what is the elegant way the content and links of the message are generated?
For example, message notifications in SF.GG

How do the different message types, content, and links come together after a user executes a behavior?
It's hard to put together such strings in your code when you push to Message Queuing:
"xxx回答了你的问题 title"
And then abruptly it in? The front end read it directly?
Is there an elegant way to do this if the message type is more (comments, replies, private messages, systems, etc.)?

Reply content:

The question is not how the message pushes this piece, but what is the elegant way the content and links of the message are generated?
For example, message notifications in SF.GG

How do the different message types, content, and links come together after a user executes a behavior?
It's hard to put together such strings in your code when you push to Message Queuing:
"xxx回答了你的问题 title"
And then abruptly it in? The front end read it directly?
Is there an elegant way to do this if the message type is more (comments, replies, private messages, systems, etc.)?

With object-oriented perspective analysis and design, user,action, URLs are delivered in different field, have very good extensibility, and small front-end limitations

${name}['回答了你的答案','关注了你的问题','修改了你收藏的文章',...][xx.type]${title}
Or
${name}({aa:'回答了你的答案',bb:'关注了你的问题',cc:'修改了你收藏的文章',...})[xx.type]${title}
What do you think

My approach is to set up a template for each type
For example, a comment template is{name}评论了你的文章{title}
The reply template is{name}回复了你的问题{title}
Wait a minute. User reviews trigger related templates, populate placeholders with content to generate a notification message

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.