It's all about the answers!

Ask a question

Mail Templates


Jonas Gryder (11663) | asked Dec 14 '10, 12:11 p.m.
Is there a way to create a customized .email template for use in more than a single project?

We would like to have several "default" versions of the same template, i.e. .email, .email1, etc. that can be used by any project.

Any ideas?

Thanks!
Jonas

3 answers



permanent link
Jonas Gryder (11663) | answered Apr 11 '11, 8:46 p.m.
Is there a way to create a customized .email template for use in more than a single project?

We would like to have several "default" versions of the same template, i.e. .email, .email1, etc. that can be used by any project.

Any ideas?

Thanks!
Jonas


Any ideas?

permanent link
Brent Ulbricht (2.5k11) | answered Apr 11 '11, 11:14 p.m.
JAZZ DEVELOPER
Is there a way to create a customized .email template for use in more than a single project?

We would like to have several "default" versions of the same template, i.e. .email, .email1, etc. that can be used by any project.

Any ideas?

Thanks!
Jonas


Any ideas?

Hi Jonas,

I can't think of anything exactly like you want to do. You could open an enhancement request through the jazz.net site at the link below.

http://jazz.net/jazz08/web/projects/Rational%20Build%20Forge#action=com.ibm.team.workitem.newWorkItem

However, another more immediate solution that I can think of is to use the service layer API client. You'll have to modify some of the contents to fit your needs, but I think it could be a quicker solution than manually entering templates via the Web UI.


use strict;

use BuildForge::Services;

my $host = 'localhost';
my $user = 'root';
my $password = 'root';
my $projectName = 'P_1';

my $conn = new BuildForge::Services::Connection($host);
my $token = $conn->authUser($user, $password);

my $project = BuildForge::Services::DBO::Project->findByName($conn, $projectName);
die('Could not find project ' . $projectName) unless defined($project);

my $template = new BuildForge::Services::DBO::Template($conn);
$template->setType('step_email');
$template->setProjectUuid($project->getUuid());
$template = $template->create();

print "Created step_email template for " . $projectName . " (" . $project->getUuid() . ")" . "\n";

my $templateBody = new BuildForge::Services::DBO::TemplateBody($conn);
$templateBody->setTemplateUuid($template->getUuid());
$templateBody->setDescription('Step .email Message');
$templateBody->setFrom('buildforge@mycompany.com');
$templateBody->setSubject('${PROJECTNAME}:${TAG} of the project ${PROJECTNAME} at step ${STEPNAME} sent you this email.');
$templateBody->setBodyText('Job ${TAG} of the project ${PROJECTNAME} at step ${STEPNAME} sent you this email.');
$templateBody->setLocale('en_US');
$templateBody = $templateBody->create();

print "Created template body (" . $templateBody->getUuid() . ") for step_email template with uuid of " . $template->getUuid() . "\n";

$conn->logout();
$conn->close();


To invoke the script, you'll of course need Perl and have downloaded the Perl services layer client code. Then you can run:

perl -I"" MyFile.pl

Brent Ulbricht
Developer/Lead - RTC Build

permanent link
Jonas Gryder (11663) | answered Apr 11 '11, 11:29 p.m.
Very nice. I like that approach! Thanks very much.
Jonas

Is there a way to create a customized .email template for use in more than a single project?

We would like to have several "default" versions of the same template, i.e. .email, .email1, etc. that can be used by any project.

Any ideas?

Thanks!
Jonas


Any ideas?

Hi Jonas,

I can't think of anything exactly like you want to do. You could open an enhancement request through the jazz.net site at the link below.

http://jazz.net/jazz08/web/projects/Rational%20Build%20Forge#action=com.ibm.team.workitem.newWorkItem

However, another more immediate solution that I can think of is to use the service layer API client. You'll have to modify some of the contents to fit your needs, but I think it could be a quicker solution than manually entering templates via the Web UI.


use strict;

use BuildForge::Services;

my $host = 'localhost';
my $user = 'root';
my $password = 'root';
my $projectName = 'P_1';

my $conn = new BuildForge::Services::Connection($host);
my $token = $conn->authUser($user, $password);

my $project = BuildForge::Services::DBO::Project->findByName($conn, $projectName);
die('Could not find project ' . $projectName) unless defined($project);

my $template = new BuildForge::Services::DBO::Template($conn);
$template->setType('step_email');
$template->setProjectUuid($project->getUuid());
$template = $template->create();

print "Created step_email template for " . $projectName . " (" . $project->getUuid() . ")" . "\n";

my $templateBody = new BuildForge::Services::DBO::TemplateBody($conn);
$templateBody->setTemplateUuid($template->getUuid());
$templateBody->setDescription('Step .email Message');
$templateBody->setFrom('buildforge@mycompany.com');
$templateBody->setSubject('${PROJECTNAME}:${TAG} of the project ${PROJECTNAME} at step ${STEPNAME} sent you this email.');
$templateBody->setBodyText('Job ${TAG} of the project ${PROJECTNAME} at step ${STEPNAME} sent you this email.');
$templateBody->setLocale('en_US');
$templateBody = $templateBody->create();

print "Created template body (" . $templateBody->getUuid() . ") for step_email template with uuid of " . $template->getUuid() . "\n";

$conn->logout();
$conn->close();


To invoke the script, you'll of course need Perl and have downloaded the Perl services layer client code. Then you can run:

perl -I"" MyFile.pl

Brent Ulbricht
Developer/Lead - RTC Build

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.