How to work with custom mail template?

Hello experts!

 

We wrote a script, the result from this script, we want it to be displayed in the letter that is sent to the user by event.

 

I created a mail template, i write                  $SCRIPT(ССС_Test)$

The recipient receives                                   $SCRIPT(ССС_Test)$

 

And there must be a value, how to fix it?

Parents
  • What type of BaseObject did you assign to the mail-template?

  • Base object = Person

    Just in case, I will clarify:
    I need to get the result of an arbitrary function (script) and display it in the email template. The function takes one parameter.

  • The script you are calling needs to have one parameter only and this parameter needs to be of type ISingleDBObject or IEntity.

    In addition, you need to add a BaseObjectTypeAttribute to the script containing the type of the base object. In your case Person.

    Sample:

    <BaseObjectTypeAttribute("Person")> _
    Public Function CCC_Test( ByVal myEntity As IEntity) As String
    	Return "My return string"
    End Function

  • Mail template:

    $SCRIPT(CCC_BS_POST_1Time)$

    Example script:

    <BaseObjectTypeAttribute("Person")> _
    Public Function CCC_BS_POST_1Time(ByVal myEntity As IEntity) As String
        Return "sdfsdfsdfsdfsdf"
            
    End Function

    Result:

  • What version are you using?

    Can you try to use ISingleDBObject instead?

    <BaseObjectTypeAttribute("Person")> _
    Public Function CCC_BS_POST_1Time(ByVal myEntity As ISingleDBObject) As String
        Return "sdfsdfsdfsdfsdf"
            
    End Function

  • My version: 8.1

    <BaseObjectTypeAttribute("Person")> _
    Public Function CCC_BS_POST_1Time(ByVal myEntity As ISingleDBObject) As String
        Return "sdfsdfsdfsdfsdf"
    End Function

    I did this, but the error repeats

  • Process: Old (default)  = ADS_ADSAccount_Insert

    Process: New (custom) = CCC_ ADS_ADSAccount_Insert

    My script = CCC_BS_POST_1TimeBkRu

            Maybe the problem is that I created a "New" process by making a copy with “Old” and adding my step there (in which this "My script" runs). I see now that in the JobQueueInfo is a "Old" naming of the process.
            How can I change the behavior so that the "New" process is used? I do not understand where to do this.

Reply
  • Process: Old (default)  = ADS_ADSAccount_Insert

    Process: New (custom) = CCC_ ADS_ADSAccount_Insert

    My script = CCC_BS_POST_1TimeBkRu

            Maybe the problem is that I created a "New" process by making a copy with “Old” and adding my step there (in which this "My script" runs). I see now that in the JobQueueInfo is a "Old" naming of the process.
            How can I change the behavior so that the "New" process is used? I do not understand where to do this.

Children