Low resolution Email Preview in Salesforce for marketing cloud connect emails - salesforce

Question about Marketing Cloud Connect - In case of Individual Email Result in Salesforce, an email preview is sent from MC to SF object along with a thumbnail preview of the email template (as base64 encoded image). This thumbnail has two problems.
a. isn’t clear enough for the sales agent to see what was sent to customer
b. can’t find what offer percentage was given to customer as the preview has ampscript value instead of actual value.
There is no way to change the default configs of MCC to increase the thumbnail size. To solve this and improve the image resolution, I’ve thought of below solutions. Is there any other possible way that you’ve done?
From customer send log, take ‘view_email_url’ and get the html using a visual force page and remove all the ‘https://click…xx.com/’ links to ensure click/ open counts aren’t impacted. Downside - # of api calls to make are higher
For every email, create a jpg preview of the email template and store it in MC and store this in SF in a custom object as ‘EmailName vs EmailPreviewUrl’. And, whenever a marketer creates a new email, they have to ensure that they create a jpg copy in MC and update associated record in Saleforce custom object. Downside - sales agent will not know what % of offer is given to customer (ps - % of offer is decided in MC automation based on raw order information we’ve about this customer). To manage this downside, we can send the offer details of each customer to SF using updateSingleSalesforceObject method everytime an email is sent. To do this, all the campaigns should be standardized to some extend.
Any other thoughts? is there any configs that I can flip to increase the image size?

To answer this question, we ended up creating a cloudpage code resource (similar to API) that returns the complete HTML of 'view_email_url' (aka view as web page) for a given email + Subscriber + datesent + BU. We used SSJS to query sendLog DE using these inputs to figure out the view_email_url value. To avoid counting view_email_url opens to tracking opens, we wrapped the open counter pixel inside a context variable - something like below.
%%[
IF _messagecontext != 'VAWP' THEN
]%%
<custom name="opencounter" type="tracking" />
%%[ ENDIF ]%%

Related

WordPress : make categories automatically match according to external API Value

I'm managing a company website, where we have to display our products. We however do not want to handle the admin edit for this CPT, nor offer the ability to access to the form. But we have to read some product data form the admin edit page. All has to be created or updated via our CRM platform automatically.
For this matter, I already setup a CPT (wprc_pr) and registered 6 custom hierarchical terms: 1 generic for the types (wprc_pr_type) and 5 targeting each types available: wprc_pr_rb, wprc_pr_sp, wprc_pr_pe, wprc_pr_ce and wprc_pr_pr. All those taxonomies are required for filtering purposes (was the old way of working, maybe not the best, opened to suggestions here). We happen to come out with archive pages links looking like site.tld/generic/specific-parent/specific-child/ which is what is desired here.
I have a internal tool, nodeJS based, to batch create products from our CRM. The job is simple: get all products not yet pushed to the website, format a new post, push it to the WP REST API, wait for response, updated CRM data in consequence, and proceed to next product. Handle about 1600 products today on trialn each gone fine
The issue for now is that in order for me to put the correct terms to the new post, I have to compute for each product the generic type and specific type children.
I handled that by creating 6 files, one for each taxonomy. Each file is basically a giant JS object with the id from the CRM as a key, and the term id as a value. My script handles the category assertion like that:
wp_taxonomy = [jsTaxonomyMapper[crm_id1][crm_id2]] // or [] if not found
I have to say it is working pretty well, and that I could stop here. But I will have to take that computing to the wp_after_insert_post hook, in order to reaffect the post to the desired category on updated if something changed on the CRM.
Not quite difficult, but if I happen to add category on the CRM, I'll have to manually edit my mappers to add the new terms, and believe me that's a hassle.
Not waiting for a full solution here, but a way to work the thing. Maybe a way to computed those mappers and store their values in the options table maybe, or have a mapper class, I don't know at all.
Additional information:
Data from the CRM comes as integers (ids corresponding to a label) and the mappers today consist of 6 arrays (nested or not), about 600 total entries.
If you have something for me, or even suggestions to simplify the process, I'll go with it.
Thanks.
EDIT :
Went with another approach, see comment below.

Variable value for Amount for Salesforce opportunity API

I'm working on a Magento website. In that, after the customer is done with adding products to the cart he fills a form and once the form is submitted, form data along with product details like SKU, price is sent to Salesforce to create a new opportunity.
The API is working and the Data is going to salesforce, but the issue is that the same product can have different prices based on certain conditions.
the new amount going to salesforce but on the salesforce side, the new amount is not reflecting but the amount when the product is created for the first time is coming.
is there any way to make the amount a variable field so the new amount reflects?
below is an image of the opportunity and the JSON data I'm sending.
{"StageName":"New Opportunity","Name":"test","CloseDate":"2021-06-04","What_are_you_interested_in__c":"Purchase New Trailer","Product_JSON__c":"[{\"Name\":\"Large Trailers\",\"Sku\":\"large-trailers-rent\",\"Quantity\":1,\"Price\":\"1301.0400\"}]","Purchase_Delivery_Contact_Phone__c":"123","On_Site_Contact_Email__c":"test-12#test-12.com","Mailing_Street__c":"test-12","Delivery_Street__c":"","Qty__c":"1","X66969__c":0,"First_Name__c":"test-12","Last_Name__c":"test-12"}
This request looks weird. Vanilla Salesforce doesn't need hacks like a text field to hold serialised JSON in it (Product_JSON__c).
Where do you send it? Normal POST to something like services/data/v51.0/sobjects/Opportunity or some custom endpoint (it'd have "/apexrest" in the URL). Even if it goes to normal endpoint - I guess there's trigger that deserialises this Product_JSON__c and creates OpportunityLineItems out of it. You'll have to chat with developer responsible for that trigger, we can't tell what's going on in there.
In general yes, it's possible to have variable prices. You (or that developer) have to read up about OpportunityLineItem. There's ListPrice,UnitPrice,TotalPrice,Discount, lots of choices to do this right and report properly on the discounts! And there are tips like
Creating an OpportunityLineItem increments the Opportunity Amount
value by the TotalPrice of the OpportunityLineItem
There are ways to do it properly, insert header (Opportunity) and line items in one go, without such hacks. See
https://salesforce.stackexchange.com/questions/155422/using-the-rest-api-to-create-parent-and-child-records-in-a-single-http-request
https://salesforce.stackexchange.com/questions/274694/can-you-upsert-using-composite-sobject-tree
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobject_tree.htm

Does the gmail api allow editing of existing email?

I am looking for ways to slim my gmail account.
E.g. Is it possible to write a script that would do one of the following:
remove attachments from quoted text.
remove quoted text.
replace images in with links to high quality images on my G-drive.
perform an arbitrary text operation on previously received emai.
Note I don't want this to happen in the new email: I want do to this on whole folders (labels) of old mail. E.g. open the conversation thread from 2017 with the subject line, "Do you have swedish aspen" and replace each occurrence of 6 pix of SA with links?
You could use the API to get old messages, the thing is these messages if they contain attachments, or images, or whatever, they are base64encoded in your mail box.
Now what you are proposing is a kind of reconstruction of your mail box. A way to do something like that would be for example to:
Get all original messages using the Gmail API
Process them with your code
Use the insert method of Gmail API to insert the slimmed messages
Delete the originals using Gmail API
Note:
Using the insert message enables you to preserve the original dates of the messages.
References:
Users.messages: get
Users.messages: insert
Users.messages: delete

Veeva Salesforce uploading presentation

maybe this is not a good quetion posted on this site, but I am trying to upload a presentation to SalesForce (https://test.salesforce.com/). I understand that at first I have to create "Key messages" which represent each slides in the presentation, then I create new CLM presentation and select presentation slides.
But then I am stucked. Is this everything to uploading the presentation or I have to migrate the presentation somewhere, upload somewhere else using FTP, etc.
I hope my question is understandable (because my English is not very good).
Thanks for help.
AFAIK, follow these steps to upload a presentation with single slide..
Create a Key message and upload the media (zip file). (Simply give key message name and upload proper well-formed zip)
Create a Presentation Slide (Just slide name)
Now, create a CLM Presentation, in which you need to browse and select the above 2 objects against their respective fields.
That's it on salesforce.
Now sync iRep app on device/iPad and it should come down in "Media".
Try this,
1.Create a new presentation
2.Go to CLM Key Messages tab and here, before creating a new key message you might need to create a new view("Create New View" link button) to group these key messages(at least that's how I do it).
Here you need to make sure that the filter method is set correctly otherwise I won't be able to see those key messages attached to this view.
So you can set sth like this(on step 2):
Field | Operator | Value
Message | contains | slide_prefix
On step 3 you need to add "Message" in "Selected fields" Tab
3.Now create a "New CLM Message" and make sure that it has "slide_prefix" on his name composition(Ex: if slide_prefix is "EXSlide" then clm message should be named like: EXSlide myslide01 or EXSlide_slide01)
4.After creating CLM key message you will be redirected to his info page where you need to upload the ".zip" file.
5.Last step is to create "New Presentation Slide"(On the bottom of the page). Here you need to input the Presentation(presentation name created on step 1), key message name(you can search for them) and a display order
Now sync the ipad and it should appear.
In addition to sTx answer, you can take a look at the "Veeva Content Creation Guidelines" (Link below). This will fit most of your developer needs.
Veeva Content Creation Guidelines
Keep in mind that often client groups have special region codes and labeling rules (see also: sTx answer to "Prefix" rules), that you have to follow, to match users and contents in a global account. If you dont, nothing will appear on the iPad. Example: yourID + Language + Country (YourID_ENG_UK.zip)
Also companys often split thier environment in two, a sandbox and a production section - Make sure you have the permission to see sandbox contents. For this purpose, activate the "Training Content" checkbox on the presentation object, to see your presentation without a migration.
All contents you create in the backend are by default visible to you on the iPad. Check the "Config" > "Media" list and look for your Zips files; if they get downloaded.

How can I generate counts for items with differing view permissions in my database without being inefficinet?

My web-app has a media upload facility which associates each uploaded media item with a collection of media items (for simplicity we'll just refer to each group of media items as an album, though the encompassing entity for media items is not as simple a structure). Each of these "albums" has the potential to have custom viewability settings which specify who can view the album (a la Facebook).
I'm trying to generate a count of media items uploaded by a user for display on the user's front page.The problem is, I can't figure out a way to do this without perusing through the data of all the "albums" (in essence, its doing the same amount of work required to collect the viewable albums).
If all the albums had the same viewability settings, I could just maintain a count of the media items and manipulate it on upload & deletion. Since they can potentially all have different viewability settings, however, I have to check the viewability permission of the viewer for each "album" to make sure its media items can be included in the count that will be displayed to him.
Consider Facebook:
Upon looking at a user's profile, you can see a count of photos uploaded by the user. Presumably this count is of all photos you're allowed to view, and not the total count of the user's photos. If this is true, it would be inefficient to peruse through all the album database rows (and rows in other tables, such as those containing the "Lists" of allowed viewers) just to generate a count; you still have another click to get to the page where you can view the photos (where a permission verification process will have to be completed again)!
Is there something I'm missing, or is this now sites handle items like these? Perhaps the process is completed the first time and the viewable albums are cached for subsequent use?
I don't know about Facebook, but... Unless you're doing something extremely complicated with the permissions, if you have a well-normalised database and properly set up indices, the join should not be that slow. Can you show the relevant schemata?
After momentarily blocking a friend from viewing some of my photos, then viewing the profile as him (using the "View as" option) at the top-right corner, it appears as though the photo count doesn't change. In other words, the count is the value of all the photos uploaded by the user, regardless of the privacy settings on each.
I'd be grateful if anyone could confirm this.

Resources