Skip to main content
Level 3
Nov 13, 2017 8:56 AM UTC
Solved

Getting a specific Mirror page URL and getMirrorURL method

Hi.

I'm trying to create a recipient delivery report in Adobe Campaign showing all the deliveries a recipient received over time.

In addition I want to add by each of the deliveries the link to the mirror page of this recipient.

for example:

http://myUrl/nl/jsp/m.jsp?c=%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%3D

The 'XXX...' part is the different part for each recipient/delivery

I'm trying to get the url programmatically using javascript.

I've looked in the documentation and also in this forum, and saw a similar issue (https://forums.adobe.com/message/9792714#9792714)

but still couldn't figure out how to do it.

According to the answer there I can use the 'GetMirrorURL' method but I'm not sure what parameters I should give to this function.

Looking in the jaspi help I saw it gets 'eventHistoId' from schema nms:eventHisto.

This table is empty on my system, and I'm not sure how it is related.

Also tried running this method with different parameters like broadlogID but I get an error saying 'Error while compiling script - GetMirrorUrl is not defined.'

Can someone please help me understand how to handle this method or is there a different way of getting the URL

Adobe Campaign Version 6.1.1 build 8754

Server version 6.1.1 build 8754

Thanks,

Sagi

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
subhajit9830660Accepted solution
Level 3
Nov 19, 2017 9:46 PM UTC

One more thing, the 2nd parameter needs to be passed as string i.e. within quotes ("1402")

12 replies

florentlb
Level 10
Nov 16, 2017 6:04 PM UTC

Hi Sagi,

Have you tried with the GetMirrorURL method from the nms:delivery schema (it can also be found in the JSAPI documentation)? You just need to pass the following parameters:

  • deliveryId: Delivery identifier
  • message: Message ID

Florent

Translate
Level 3
Nov 19, 2017 9:32 AM UTC

Hi Florent,

Tried using it but it didn't work.
Also I'm not sure I'm using the right 'message'

I only found Message ID in nms:broadlogMsg table and its the same value (1402) for all recipients that the email was sent to.

This message id is indicating if an email was sent or not and failure reason, I don't think this is what the GetMirrorURL expect to get.

Can you advise where can I find the required message ID?

When trying to run it like that I get the same error:

var url = GetMirrorURL (232676406,1402)

19/11/2017 09:30:11 JST-310000 Error while compiling script 'WKF2545/js2' line 2: GetMirrorURL is not defined.

Translate
Level 3
Nov 19, 2017 9:33 PM UTC

Hi Sagi,

Please use nms.delivery.GetMirrorURL(232676406,1402) and not only GetMirrorURL(232676406,1402).

Thanks,

Subhajit

Translate
subhajit9830660Accepted solution
Level 3
Nov 19, 2017 9:46 PM UTC

One more thing, the 2nd parameter needs to be passed as string i.e. within quotes ("1402")

Translate
Level 3
Nov 21, 2017 8:50 AM UTC

Its working now!

Many thanks for your help

Sagi

Translate
courtneyd578424
Level 2
Nov 21, 2017 2:05 PM UTC

Hi Sagi.

I'm not a developer, I'm an email marketer trying to make this work too. Would you be willing to share your code?

Translate
Level 3
Nov 21, 2017 2:36 PM UTC

Hi sure

I've used in a JavaScript activity inside a workflow for example:

var url = nms.delivery.GetMirrorURL(332656168,"20916262")

logInfo('var url: ' + url)

332656168 - is the delivery id

20916262 - is the broadlogId (not the messageID)

If you need to use it with variables like I did, then:

instance.vars.deliveryId = 332656168

instance.vars.broadlogId = 20916262

instance.vars.broadlogId = instance.vars.broadlogId.toString()

var url = nms.delivery.GetMirrorURL(instance.vars.deliveryId,instance.vars.broadlogId)

logInfo('var url: ' + url)

Hope it helps!

Translate
Dec 4, 2020 4:53 PM UTC
@sagi_laniado Is there a way to dynamically pull back all available deliveryIds and broadLogIds instead of defining 1 version in your code?
Translate
courtneyd578424
Level 2
Nov 21, 2017 9:39 PM UTC

It was helpful! I am getting this error though:

11/21/2017 4:37:20 PM JavaScript: error while evaluating script 'WKF1117/js'.

11/21/2017 4:37:20 PM Error while executing the method 'GetMirrorURL' of service 'nms:delivery'.

11/21/2017 4:37:20 PM Cannot load document of type 'Deliveries (nms:delivery)' satisfying condition '(@id = 332656168) AND ((@deleteStatus = 0))'.

11/21/2017 4:37:20 PM The requested database record does not exist.

11/21/2017 4:37:20 PM AND ((D0.iDeleteStatus = :2))' could not be executed.   Param(0)=332656168   Param(1)=0

11/21/2017 4:37:20 PM SQL statement 'SELECT   D0.iMappingId, D0.iDeliveryMode, D0.iMidRemoteId, E1.sMirrorURL, E1.sAccount, E1.sPassword, E1.sServer, D0.mData FROM NmsDelivery D0 JOIN NmsExtAccount E1 ON (E1.iExtAccountId = D0.iDeliveryProviderId) WHERE (D0.iDeliveryId = :1)

Translate
Level 3
Nov 21, 2017 11:00 PM UTC

Hi,

I looks like you've copied the code I shared without replacing the parameters.

You probably don't have a delivery id =332656168 in your system so its failing

also the broadlogid need to match the delivery id.

Just replace the parameters to correspond the delivery you wish to check.

Sagi

Translate
Level 2
Jan 8, 2022 8:31 AM UTC

Hi Sagi,

 

I tried using the Javascript function you shared above in order to fetch the mirror page URL with custom delivery & broadlogId, but still I am getting "the record not found" error. I tried for multiple deliveries.

Any suggestions please.

 

Thanks

Translate
courtneyd578424
Level 2
Nov 22, 2017 2:41 PM UTC

Thanks so much! Got it to pull back the url!

Translate