result.DocumentBytes, defaultTemplate.AttachmentName + "." + "jpg"); // was result.Extension. It will be replaced by pdf