Send email with new products

  • Updated

This Action Map sends an email with a list of new products.

NOTE: This particular Action Map requires Perfion 4.6.1 or later.

This example is provided as inspiration only. It must be adapted to your Perfion environment to work. Perfion Support does not assist with such adaptations. Please contact your Perfion Partner or your Perfion consultant if you need assistance.

Action Map

  • All lines containing a Command are created as virtuals. This is a recommended best practice
  • The "." in the first From field means "current Perfion database"
  • The SET command:
    • defines the SMTP gateway used to send the email
    • creates a $Header-variable for the email
    • creates an $ItemTemplate-variable to be used for each item in the email (template contains a link to the item in the Perfion Web Client)
  • SendEmail executes a script that creates the email in HTML-format and sends it to defined recipients

Sample data for building Action Map

NOTE: Line breaks are omitted if you paste scripts from the table below directly to an action. In stead, paste script to Notepad++ and then copy from there. That will preserve line breaks when you paste into an action.

Action Map - From To Command Action Script Note
. Items SELECT.PERFION   <Query>
<Select languages='EN'>
<Feature id='**' view="Config" />
</Select>
<From id ='100'/>
<Where>
<Clause id='Brand' operator='=' value='Normal' />
<Clause id='String' operator='!=' value='Dummy' />
<Clause id='ProductStatus' operator='=' value='New' />
</Where>
</Query>
 
ID          
Value          
ItemName          
    SET      
host=DOMAIN;port=XXX;username=YYY;password=ZZZ SMTP        
  $Header     <h1>New items in Perfion</h1><br>  
  $ItemTemplate     <a href='webclient.local/PerfionWebClient/#/editor/Product/String/{value}'>{ItemName}</a><br>  
SendEmail   EXECUTE.SCRIPT  

string message = var["$Header"] + FillTemplate( "" + var["$ItemTemplate"], "Items", "<br>" );

SendEmail( "sender@domain.com",
          "recipient@domain.com",
          "New items in Perfion",
          message,
          format:"html"
);

 

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.