Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Send email step with gif #56

stankomaksimovic2510 ·

Hi,

I am using Misc > Send Email step and its working perfectly fine, however I would like to do something fun for my team.

Each time compilation has succeded or failed I would like to attach a GIF/JIF call it what you like.

Is there any way to do it?

  • solved #4
  • replies 5
  • views 2405
  • stars 0
robinshen ADMIN ·

How about sending it as attachment?

stankomaksimovic2510 ·

Sending it as attachment works, but i need this to be visible as signature more than attachment, the idea is to be more in your face style rather than click to open.

robinshen ADMIN ·

Check it further and there is an elegant approach:

  1. Define a variable say "imageData" in configuration
  2. Add a step to run below script before your send mail step:
groovy:
import com.pmease.quickbuild.util.FileUtils;
import org.apache.commons.codec.binary.Base64;
def bytes = FileUtils.readFileAsBytes(new File("/path/to/your/gif"));
vars.get("imageData").setValue(new String(Base64.encodeBase64(bytes)), false);
  1. Use below to embed images in your email template:
<img src="data:image/gif;base64,${vars.getValue("imageData")}" alt="img" />
stankomaksimovic2510 ·

The script is working fine and picking up the value as it should, however once e-mail has been sent the final product is not gif.

I have tried adding style: width:150px command in case it is downsizing it automatically but it is not the case.

How the final product looks like I will show here GifNotDispayed.jpg

robinshen ADMIN ·

The same exact code works at my side. I am using outlook 365. Can you please check your mail client to see if it is allowed to show embedded image?