Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a proper document #214

Open
neginsadeghi opened this issue Dec 30, 2023 · 3 comments
Open

a proper document #214

neginsadeghi opened this issue Dec 30, 2023 · 3 comments

Comments

@neginsadeghi
Copy link

Hi, I want to use this system but I don't know how to create custom variables and feed them with values and ...

Is there any wiki/document that I could read and do it ?

@SebastianStehle
Copy link
Collaborator

Yes, Dokumentation is not existent. If you describe what you want to do I can probably help

@neginsadeghi
Copy link
Author

I want to create an email template called template01, I want it to have a default text body and have some variable that I could feed them based on each event.

consider the following :

I want to use this system for a network monitoring system, I want to have these variables :

IP address, trigger, date, customer:

after feeding it would be :

Dear {{customer}}
your IP is : {{IP}}
and you triggered : {{trigger}}
at date : {{date}}

see the link bellow
xyz.com
thanks

How can I create such template and how can I send emails with the template while feeding the values of variables ?

if you could tell me how can I do it using rest API, it would be great

Thanks

@SebastianStehle
Copy link
Collaborator

I would create the email template with the UI, because it is much easier. You will also see a few default placeholders being uses, e.g. the user.displayName and so on.

In general Notifo used Liquid / Fluid as a template engine and the following variables are available:

  • user.
  • app
  • notification
  • notifications (If multiple notifications are grouped together)

See https://github.com/notifo-io/notifo/blob/main/backend/src/Notifo.Domain/Liquid/LiquidContext.cs

The notifications have a property called "properties", which can be used to add user generated value to a notification.

From the perspective of the API you generate a new event using the following endpoint: https://app.notifo.io/api/docs/index.html?url=/api/openapi.json#tag/Events/operation/Events_PostEvents

This is then converted to a notification. But you have to remember to enable the email channel on the user level or notification level to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants