Alessandro,
Good. It definitely will help to take a couple of days and learn XSLT.
In your Path Definition of your branch (the pencil)
/*[/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']//BOM/BO/Documents/row/TrackingNumber !='']
This checks to see if the Tracking number is not empty. You can add other conditions as well this. The atoms following the path will be run if the condition defined in the path are true.
Then you want to have your SqlCall find the email addresses for the business partner that you want it to send the email to. You might want to add 2 local variables defined as:
CardCode /vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']//BOM/BO/Documents/row/CardCode
ContactPersonCode /vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']//BOM/BO/Documents/row/ContactPersonCode
to make it easier to create your SQL statement in your sqlCall
#select E_MailL from OCPR WHERE CardCode='$CardCode' AND CntctCode='$ContactPersonCode'
Then in the XFORM prior to the EMail atom, you are going to need to define your SMTP host information and use the information retrieved by the SQL call for the to email addresses.
<xsl:template name="transform">
<email xmlns="">
<!--<xsl:variable name="cdoc" select="document('/com.sap.b1i.vplatform.ide/mode/mode.xml')"/>-->
<connect>
<host>
<!--<xsl:value-of select="$cdoc/vpf:vPlatform/vpf:smtpserver"/>-->
</host>
<port>
<!--<xsl:value-of select="$cdoc/vpf:vPlatform/vpf:smtpport"/>-->
</port>
<user>
<!--<xsl:value-of select="$cdoc/vpf:vPlatform/vpf:smtpuser"/>-->
</user>
<password>
<!--<xsl:value-of select="$cdoc/vpf:vPlatform/vpf:smtppwd"/>-->
</password>
</connect>
<envelope>
<to>
<address>
<xsl:value-of select="vpf:Msg/vpf:Body/vpf:Payload[./@id='atom2']/jdbc:ResultSet/jdbc:Row/jdbc:E_MailL" />
</address>
</to>
<cc>
<address>
<!--optional - multiple elements allowed-->
</address>
</cc>
<bcc>
<address>
<!--optional - multiple elements allowed-->
</address>
</bcc>
<from>noreply@whoeverweare.com</from>
<subject>
Invoice <xsl:value-of select="vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']//BOM/BO/Documents/row/DocNum" /> Tracking Number
</subject>
<message>
<xsl:value-of select="vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']//BOM/BO/Documents/row/TrackingNumber"/>
</message>
<attachment doc="/ds/grp/doc" pltype="">
<!--optional - multiple attachments allowed-->
</attachment>
</envelope>
</email>
</xsl:template>
I have not completed the task, nor has it been tested. I am just trying to give you a head start and hopefully help others.