cancel
Showing results for 
Search instead for 
Did you mean: 

Change "subject" in Receiver Mail Adapter Module

Former Member
0 Kudos

Hi all,

following the "How To Guide" I developed a Module for my receiver mail adapter. Everything works fine.

Now my question: is it possible to change the content of the mail-"subject" in the module?

Your help is appreciated.

Carmen

Accepted Solutions (0)

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

In SP14 you can change the subject with JavaMapping, as it is part of the additional header fields.

But I have not found a way to use them in an adapter module so far.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

maybe I should describe my problem more detailed:

My scenario is RFC-XI-Mail. I use the mail package to determine the receiver of the mail dynamically. Another thing I want to do, is to attach a file to this mail which is located on the server. So far so good.

My problem is, that the name of the file (which I need in my adapter module) changes for every mail. So what I need is the possibility to deliver it to the adapter module.

I found out that it is possible to read the payload. So my idea was to hand it over in one of the fields like "subject". But now I want to change the subject afterwards...(delete the filename).

Maybe you have another idea?

Regards

Carmen

MichalKrawczyk
Active Contributor
0 Kudos

Hi Carmen,

>>> So my idea was to hand it over in one of the fields like "subject". But now I want to change the subject afterwards...(delete the filename).

if you're using mail package then this is possible

exactly as you've described you just have to change

the subject TAG in the adapter module

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

Former Member
0 Kudos

Hi Michal,

that's what I tried. Unfortunately without success...

// first I read the payload

XMLPayload payload = msg.getDocument();

String plcontent = new String (payload.getContent());

// .... here I read the filename and delete it from the subject tag

// then I try to set the payload with the new subject

plcontent.replaceFirst(subject, newsubject);

payload.setContent(plcontent.getBytes());

msg.setDocument(payload);

Any idea where I am wrong?

Regards,

Carmen

Former Member
0 Kudos

Hi Michal,

solved the problem now. I had a mistake in my replace statements...

Thanks,

Carmen