Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Mail Templates

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

0 votes



3 answers

Permanent link
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?

0 votes


Permanent link
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

0 votes


Permanent link
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

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Dec 14 '10, 12:11 p.m.

Question was seen: 4,733 times

Last updated: Dec 14 '10, 12:11 p.m.

Confirmation Cancel Confirm