Page tree
Skip to end of metadata
Go to start of metadata

Mail gönderirken MailerQue, MailerBody ve MailerAttachment tablolarını kullanarak mail atabiliyoruz. Aşağıdaki örnek kod ile dosya eki olan bir mail gönderimi gösterilmiştir. Ayrıca birden fazla mail adresine gönderim yapılacak ise Regex ile mail adreslerinin içerisinde bir loop oluşturarak her birisine ayrı ayrı mail gönderimi yapılabilinir.

Örnek Kod Bloğu
<Script Name="">
  <Group Description="$(To) $(WorkItem) ve $(MailBody) bilgileri parametre olarak gelmektedir." />
  <Group Description="Birden fazla mail adresi ';' ile ayrılarak eklenebilmektedir. Her mail adresini ayırarak ayrı ayrı mail gönderimi yapılmaktadır." />
  <SetVariable Name="$(Pattern)">
    <Value Culture="" Target="None" IsCDATA="True"><![CDATA[([^;]+)]]></Value>
  </SetVariable>
  <Regex Input="$(To)" Pattern="$(Pattern)" Replace="False" MatchVariable="Match">
    <SetVariable Name="$(To)">
      <Value Culture="" Target="None">$(Match)</Value>
    </SetVariable>
    <SetVariable Name="$(MailID)">
      <Value Culture="" Target="Guid">NewGuid</Value>
    </SetVariable>
    <FillSchemaWithXml Name="MailerBody" VariablePrefix="" XPath="/*" MasterDetailXPath="" DeletedRowsPath="" Repository="">
      <Columns>
        <Column Node="" Name="Id">
          <Value Culture="" Target="Guid">$(MailID)</Value>
        </Column>
        <Column Node="" Name="Data">
          <Transform Data="::." ReturnType="OuterXml">
            <StyleSheet>
              <Value Culture="" Target="None"><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" omit-xml-declaration="yes" />
  <xsl:template match="/">
    <html>
      <head />
      <body>
       $(MailBody)
											</body>
    </html>
  </xsl:template>
</xsl:stylesheet></Value>
            </StyleSheet>
            <Arguments />
          </Transform>
        </Column>
      </Columns>
      <Perform />
    </FillSchemaWithXml>
    <FillSchemaWithXml Name="MailerAttachment" VariablePrefix="" XPath="/*/Geribildirim/LisansorEkleri/Details/Template" MasterDetailXPath="" DeletedRowsPath="" Repository="">
      <Columns>
        <Column Node="" Name="Id">
          <Value Culture="" Target="Guid">$(MailID)</Value>
        </Column>
        <Column Node="" Name="MailId">
          <Value Culture="" Target="Guid">$(MailID)</Value>
        </Column>
        <Column Node="" Name="Data">
          <GetFileContents Id="eval::Id" />
        </Column>
        <Column Node="" Name="Name">
          <Value Culture="" Target="None">eval::FileName</Value>
        </Column>
      </Columns>
      <Perform />
    </FillSchemaWithXml>
    <FillSchemaWithXml Name="MailerQue" VariablePrefix="" XPath="/*" MasterDetailXPath="" DeletedRowsPath="" Repository="">
      <Columns>
        <Column Node="" Name="Id">
          <Value Culture="" Target="Guid">$(MailID)</Value>
        </Column>
        <Column Node="" Name="Batch">
          <Value Culture="" Target="None">$(InstanceId)</Value>
        </Column>
        <Column Node="" Name="SenderName">
          <Value Culture="" Target="None">Gönderici Adı</Value>
        </Column>
        <Column Node="" Name="SenderMail">
          <Value Culture="" Target="None">gonderici.email@domain.com</Value>
        </Column>
        <Column Node="" Name="ToName">
          <Value Culture="" Target="None">İlgili Kişi</Value>
        </Column>
        <Column Node="" Name="ToMail">
          <Value Culture="" Target="None">$(To)</Value>
        </Column>
        <Column Node="" Name="Subject">
          <Value Culture="" Target="None">Konu</Value>
        </Column>
        <Column Node="" Name="SendAfter">
          <Date Operation="Add" Part="Minute">
            <Value Culture="" Target="Date">Now</Value>
            <Value Culture="" Target="Integer">1</Value>
          </Date>
        </Column>
        <Column Node="" Name="Status">
          <Value Culture="" Target="Integer">1</Value>
        </Column>
      </Columns>
      <Perform />
    </FillSchemaWithXml>
  </Regex>
</Script>
  • No labels