Replace Mail Merge with syncfusion on html string data - .net-core

I 'm tried to replace mail merge on word template with my data using syncfusion library. Is it possible to using html format (it is a bold text) and text format applied on my document based on mail merge key?
I am expect the format of html string applied on my document template

Yes, it is possible to perform Mail merge with the formatted HTML string which can be achieved with the help of MergeField event and InsertXHTML API. Please find the example project from below and let us know if it helps.
http://www.syncfusion.com/downloads/support/directtrac/general/ze/DocIO_CoreApp1705852960
To know more about mail merge and its events, kindly refer the following documentation link
https://help.syncfusion.com/file-formats/docio/working-with-mailmerge#event-support-for-mail-merge
Note: I work for Syncfusion
Regards,
Dilli babu.

Related

Format date in SendGrid template portal

I'm using SendGrid portal to manage my email templates using handlebar substitutions as its reference in this link https://sendgrid.com/docs/ui/sending-email/using-handlebars/#substitution
I would like to know if it is possible to convert and/or format dates in the SendGrid transactional template portal.
This is my HTML template in SendGrid portal:
<p>This report was generated on {{GenerationTimeUtc}}</p>
This is the dynamic data sent to SendGrid:
{
"GenerationTimeUtc":"2018-09-14T21:16:30.1467851Z"
}
I would like to show it in a more readable way like "This report was generated on May 04" instead of showing "This report was generated on 2018-09-14T21:16:30.1467851Z"
I'm using SendGrid V3
Thanks in advance.
You can make use of formatDate for this type of formatting, referencing standard dateTime format flags.
<p>Join us {{formatDate dateString "M d"}}</p>
And similar implementation using a different date format…
<p>Join us {{formatDate dateString "yyyy-mm-dd"}}</p>

Regular expression validation for string [01:3:14/ 1:8:20]

I am pulling my head for below problem.
I have text box in my application that will take time in the format 1(days):23(hours): 15(minutes).
I want to apply validation for this field so it will take string in the format [01:05:15/ 1:4:30] only.
Please tell me the workaround for this.
You can use separator like below.
^([0-2]\d?|3[01]):([0-1]\d?|2[0-3]):(00?|15|30|45)$
If you need more information check below.
http://msdn.microsoft.com/en-us/library/hs600312(v=vs.110).aspx
http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.110).aspx

Retrieve data from a website via Visual Basic

There is this website that we purchase widgets from that provides details for each of their parts on its own webpage. Example: http://www.digikey.ca/product-search/en?lang=en&site=ca&KeyWords=AE9912-ND. I have to find all of their parts that are in our database, and add Manufacturer and Manufacturer Part Number values to their fields.
I was told that there is a way for Visual Basic to access a webpage and extract information. If someone could point me in the right direction on where to start, I'm sure I can figure this out.
Thanks.
How to scrape a website using HTMLAgilityPack (VB.Net)
I agree that htmlagilitypack is the easiest way to accomplish this. It is less error prone than just using Regex. The following will be how I deal with scraping.
After downloading htmlagilitypack*dll, create a new application, add htmlagilitypack via nuget, and reference to it. If you can use Chrome, it will allow you to inspect the page to get information about where your information is located. Right-click on a value you wish to capture and look for the table that it is found in (follow the HTML up a bit).
The following example will extract all the values from that page within the "pricing" table. We need to know the XPath value for the table (this value is used to instruct htmlagilitypack on what to look for) so that the document we create looks for our specific values. This can be achieved by finding whatever structure your values are in and right click copy XPath. From this we get...
//*[#id="pricing"]
Please note that sometimes the XPath you get from Chrome may be rather large. You can often simplify it by finding something unique about the table your values are in. In this example it is "id", but in other situations, it could easily be headings or class or whatever.
This XPath value looks for something with the id equal to pricing, that is our table. When we look further in, we see that our values are within tbody,tr and td tags. HtmlAgilitypack doesn't work well with the tbody so ignore it. Our new XPath is...
//*[#id='pricing']/tr/td
This XPath says look for the pricing id within the page, then look for text within its tr and td tags. Now we add the code...
Dim Web As New HtmlAgilityPack.HtmlWeb
Dim Doc As New HtmlAgilityPack.HtmlDocument
Doc = Web.Load("http://www.digikey.ca/product-search/en?lang=en&site=ca&KeyWords=AE9912-ND")
For Each table As HtmlAgilityPack.HtmlNode In Doc.DocumentNode.SelectNodes("//*[#id='pricing']/tr/td")
Next
To extract the values we simply reference our table value that was created in our loop and it's innertext member.
Dim Web As New HtmlAgilityPack.HtmlWeb
Dim Doc As New HtmlAgilityPack.HtmlDocument
Doc = Web.Load("http://www.digikey.ca/product-search/en?lang=en&site=ca&KeyWords=AE9912-ND")
For Each table As HtmlAgilityPack.HtmlNode In Doc.DocumentNode.SelectNodes("//*[#id='pricing']/tr/td")
MsgBox(table.InnerText)
Next
Now we have message boxes that pop up the values...you can switch the message box for an arraylist to fill or whatever way you wish to store the values. Now simply do the same for whatever other tables you wish to get.
Please note that the Doc variable that was created is reusable, so if you wanted to cycle through a different table in the same page, you do not have to reload the page. This is a good idea especially if you are making many requests, you don't want to slam the website, and if you are automating a large number of scrapes, it puts some time between requests.
Scraping is really that easy. That's is the basic idea. Have fun!
Html Agility Pack is going to be your friend!
What is exactly the Html Agility Pack (HAP)?
This is an agile HTML parser that builds a read/write DOM and supports
plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor
XSLT to use it, don't worry...). It is a .NET code library that allows
you to parse "out of the web" HTML files. The parser is very tolerant
with "real world" malformed HTML. The object model is very similar to
what proposes System.Xml, but for HTML documents (or streams).
Looking at the source of the example page you provided, they are using HTML5 Microdata in their markup. I searched some more on CodePlex and found a microdata parser which may help too: MicroData Parser

how to get xml html after transpose and databind()

I have some code that uses xsl and xml.
The Xml control is on the design page.
The xml control id is xmlApplication
The xmlstring is generated and xsl has the format with all the tables and cells etc.
Here is a part of thecode of a page which generates the final product which shows the xml in a certain format.
xmlApplication.Document = xmlDoc;
xmlApplication.Transform = transApp;
xmlApplication.DataBind();
I am guessing after xmlApplication.Databind(), xmlApplication will be converted into something that can be put inside .
Is it possible to grab as a string?
Please let me know if I have a wrong idea abut this.
Thanks a lot.
http://www.logiclabz.com/c/net-c-function-to-convert-xml-document-into-html-string-using-xslt.aspx

Drupal: How to format email message using node invite module?

I am using the node invite and token module.
I have followed this flash tutorial video: http://www.adevbox.com/files/2008-06-25_1703.swf
My problem is regarding the email format being sent.
In the ?q=admin/settings/node_invite
I have checked the blog entry checkbox. Now the node invite works but I can't format my body section value correctly.
For example:
I entered in the textarea
Hi <bold>
Then the result when I open the email message is still the same:
Hi <bold>
Same with if I use <b>bold here</b> then it will also be the format when I open the email message.
How can I format it correctly? Am I missing something simple? I am thinking of using htmlspecialchars but I don't where to put it.
Thanks in advance :)
Kind Regards,
Mark
My understanding of the Invite module is that there is no Input Filter for the template. This means that the only format that is accepted is plain text. This means that it will convert HTML into the escaped code you see.
You can validate this looking at the variables in the database. Your best bet it so path Invite (or ask for a features) to allow HTML as a valid format.

Resources