HI all,
I have an XML with the different email bodies. I am using xslt to prepare an email template for sending these emails. I also want to include <subject> tag to the xml so that the email is more maintainable.I am using spring to send mail. I need to set the body ans subject of the mail. Body of the mail i am setting by using xslt transformation. I want to set the subject too.Please help me out if you have any idea!! I don't want to use xml parsing just for setting subject.Is there any way i can get the subject value using xslt??
here is my xml:
<mailMessage>
<mail type="pinReset">
<subject>Regarding account pin reset</subject>
<body>
<prefix>Hello User You have initiated a pin reset Please click
on the link below to reset your pin</prefix>
<suffix>Thank you</suffix>
</body>
</mail>
<mail type="emailUpdate">
<subject>Regarding account email update</subject>
<body>
<prefix>emailupdated</prefix>
<suffix>thank u</suffix>
</body>
</mail>
<mail type="failureCount">
<subject>Regarding account unsuccessful login</subject>
<body>
<prefix>failureCount</prefix>
<suffix>thank u</suffix>
</body>
</mail>
</mailMessage>
I want to fetch the subject separately.
You could create a second, very simple XSLT template that only outputs the subject line.
You can pass the string value for the subject, and the mail type as parameters to the XSLT transformation, and the transformation can be written in such a way as to produce the whole email message.
Related
I've write a functionality about send email process. Here I've set Mail Server details admin setting. And write a below code for sending email. I can successfully send & receive email to my gmail account. But Here I've added some paragraph with anchor tag value that is click me.
<cfoutput>
<cfmail from="test#gmail.com" to="test#gmail.com" username="myemail#gmail.com" password="mypass" port="587" subject="Chaange title" >
<p> I'm from test link click Me 2! </p>
</cfmail>
</cfoutput>
The issue is in my email not received as a click me as a link. Instead it will display entire html about anchor tag. FYR please refer my email content image.
Note : I've already tried with cfsavecontent too but it's not help me.
Could you any one help on this. Why it's was happen ? Thanks in advance.
Add type="html" to your cfmail tag. That should indicate to the end user's email client that the message should be displayed as an HTML page instead of just plain text.
I am using siddhi with WSO2.
In siddhi email there is an option that says that is posible to send html. According to this I suppose there is a way to send template html. I want these because I need a more frindly email than just the event in plain txt.
Or something to change the body of the email.
#source(type='email', #map(type='xml'), username='receiver.account', password='account.password',content.type='text/html,)
define stream inputStream (name string, age int, country string);
Up to now I haven't found a way to add the html or where to add it.
To send HTML email instead of #map(type='xml') use
#map(type = 'text', #payload("""
<html>
<body>
Hi {{name}} <br/>
Good luck with your email :)
</body>
</html>
"""))
with proper email tempate.
I have radio groups setup in my DocuSign template, and am trying to fill it up while creating an envelope using the template. Here's the XML structure that I've made:
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<accountId>******</accountId>
<status>sent</status>
<templateId>******</templateId>
<templateRoles>
<templateRole>
<email>******#test.com</email>
<name>****** ******</name>
<roleName>General</roleName>
<clientUserId>UserId</clientUserId>
<tabs>
<textTabs>
<text>
<tabLabel>Name</tabLabel>
<value>Test User</value>
</text>
<text>
<tabLabel>Address 1</tabLabel>
<value>123 Main Street</value>
</text>
<text>
<tabLabel>Address 2</tabLabel>
<value>Venice, CA 12345</value>
</text>
</textTabs>
<radioGroupTabs>
<radioGroup>
<groupName>Radio Group 1</groupName>
<radios>
<radio>
<selected>True</selected>
<value>Radio 1</value>
</radio>
<radio>
<selected>False</selected>
<value>Radio 2</value>
</radio>
</radios>
</radioGroup>
</radioGroupTabs>
</tabs>
</templateRole>
</templateRoles>
</envelopeDefinition>
Is this XML request correct? The 'Name' and 'Address *' tabs are correctly filled, but the radio group tabs are not filled at all.
Your XML looks correct to me; in fact, I was able to copy/paste (including the radioGroupTabs portion) from your code sample into my own request and it works as desired -- i.e., the radio button specified as selected in the request is indeed selected when the recipient opens the envelope.
I'd suggest you verify that the values of groupName and value (for each Radio) in the Request XML match exactly with the corresponding values specified for the Radio Button Tag Properties, as shown here in the DocuSign UI -- and keep in mind that values are case-sensitive:
I've been trying to send an email from my magento module but for some reason I can't get the template to work:
The template is set as follows:
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('application_status_email');
The headers and all are being sent correctly.
I've created a file called application_status_email.html in app/locale/en_US/template/email and the selected language on the admin panel is English(US). Thoughts?
The template itself simply contains:
<div>
Message:
{{var message}}
</div>
But for some reason my emails are sent without anything content. I have another module sending emails, but from the front end wich works fine, with the template located in the same folder ...
Remember to add your email template to the configuration files:
<global>
<template>
<email>
<application_status_email>
<label>Application Status Message</label>
<file>application_status_email.html</file>
<type>html</type>
</application_status_email>
</email>
</template>
</global>
Hope that helps!
Thanks,
Joe
How can print a page using xslt.
i need a link, or a button which when clicked invokes the print page printer dialog box.
I suspect you need to specify a bit more about what you are trying to do.
XSLT is simply a way to turn one block of text into another. The input is generally an xml buffer and the output is some text rendering of that buffer.
It is possible that you are trying to generate a script using XSLT and that you want that script to be able to open a print dialog when it is run by something e.g. you generate javascript, that then runs on a browser.
Can you describe in more detail what you want to achieve?
The following in an html page gives you a print link:
Print
XSLT is a language for transforming XML documents. That means you can add/modify content. Assuming your output is HTML, you can do this:
<xsl:template match="top">
<html>
<head>
</head>
<body>
<input name="print" type="button" value="Print"
onclick="javascript:window.print()">
<xsl:apply-templates />
</body>
</html>
</xsl:template>
But of course, where exactly the button has to go depends on your needs. I'd additionally, add a media=print specific CSS at the top so that the document comes out neat!