Python SMTP Email Code - How to Send HTML Email from Python Code with Authentication at SMTP Server
Introduction This post has the complete code to send email through smtp server…
May 07, 2020
Twig is a powerful template engine for php. Drupal uses it heavily.
Lets look at some of the most useful methods and their syntax.
{% raw %}
{% set product_title = "Some value" %}
{% endraw %}
If you want to assign value to a variable from some object.
{% raw %}
{% set product_title = "#{paragraph.getTitle()}" %}
{% endraw %}
Say, I have a rendered string and I want to strip html tags from it. And, finally trim it. In this example, you will also see array usage.
{% raw %}
{% set my_code = content.field1[0] | striptags | trim %}
{% endraw %}
{% raw %}
{% if content.field_usa_code[0] %}
{% set usa_code = content.field_usa_code[0] | striptags|trim %}
{% endif %}
{% endraw %}
{% raw %}
{% set link_india = "https://www.xyz.com/#{india_code}/?param1=#{india_code}" %}
{% endraw %}
Here, I’m using variables inside a string. Take a look at its alternative below.
{% raw %}
{% set link_india = "https://www.xyz.com/" ~ (india_code) ~ "/?param1=" ~ (india_code)" %}
{% endraw %}
{% raw %}
{% set amazon_link_usa = "https://www.xyz.com/?param1=" ~ (product_title | slice(0,50) | url_encode) ~ "¶m2=#{usa_code}" %}
{% endraw %}
Here, I’m trimming the big string to 50 character max. Even if string is small, this code works. And its using another function url_encode to url encode a parameter to http query.
Introduction This post has the complete code to send email through smtp server…
Introduction We will introduce a Package Manager for Windows: . In automations…
If your youtube video looks like:https://www.youtube.com/watch?v=g0kFl7sBdDQ…
Introduction Lets assume we have a csv something similar to following: Python…
Introduction We will list few interesting automation techniques with powershell…
Introduction Consider a scenario where you are building a docker image on your…
Introduction This post has the complete code to send email through smtp server…
Introduction In a normal email sending code from python, I’m getting following…
Introduction In one of my app, I was using to talk to . I have used some event…
Introduction So you have a Django project, and want to run it using docker image…
Introduction It is very important to introduce few process so that your code and…
Introduction In this post, we will see a sample Jenkin Pipeline Groovy script…