Menu

Use SQL OQL in E-Mail Body of notifications

Zwettler
2022-07-05
2022-07-07
  • Zwettler

    Zwettler - 2022-07-05

    Hello! I know the usage of variables like $this->user_id$ in the body of e-Mails very well.
    But can i also use SQL / OQL Statements in the body of an e-mail-notification?
    e.g. SELECT status from ...
    or CASE satus = 'new' (xxxx)

     
  • Vincent @ Combodo

    Hi,
    No there isn't any solution to put OQL query placeholder in Notification, also you can provide URL to that particular OQL Search, you can also create a QueryPhrase.
    It would be great if you could use notification placeholders to fill the parameters within the hardcoded url, but I am not sure that this would work also it would be nice. Of course this is assuming that the recipient has access to that class and to the console .

    There isn't any possibility to put any CASE nor IF THEN ELSE statement which would modify the content of the notification. The workaround is to have different trigger/action for the different cases.

     
  • Pierre Goiffon

    Pierre Goiffon - 2022-07-06

    Hello Zwettler, can you describe what you wanted to do functionnaly ? Maybe there are other way we can think of ?

     
  • Zwettler

    Zwettler - 2022-07-06

    Hi Pierre, what i like to do is the following:
    Situation:
    - we are using the extension "mail to ticket" to create user-request automatically (cron.php)
    - the agent gives his answer in the portal
    - the user writes back via e-mail (e.g. Outlook)
    - the problem is, that the content of the e-mail gets very very long durch the conversation ...
    - ... because each answer contains the whole public log. And this grows with each email being sent.

    What i would have liked to realize: IF last entry is from agent -> send the whole publiclog | if last entry is from user(caller) -> send only the head, what is equal to the last entry.

    Any idea?

    kind regards
    ZT

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2022-07-06

    ( ignore this, wrong thread )

     

    Last edit: Jeffrey Bostoen 2022-07-06
  • Vincent @ Combodo

    There is a simpler way, without writing any extension.
    Create a TriggerOnObjectUpdate with context = 'cron', linked to a notification for the agent (last entry)
    Create another TriggerOnObjectUpdate with context = 'Portal', linked to a notification for the caller (full caselog)

     
    👍
    1

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.