0

I am new to the slack integration. I want to use a flow to send a message to slack. For security reasons I don't want to send record information, just a custom message. I can use email to send it, but to click a link in the email you have to expand the email. What I want is to have two lines of text one that is a link. Here is how it comes in now current state Here is what I really want it to look like how I want it

2 Answers 2

2

Instead of utilizing slack integration (which is limiting), you can set up a record-triggered flow to send an email based on specific entry criteria and have the flow send an email alert to the slack channel or conversation’s unique email address. Using email templates, you can create the layout you’re looking for to post in Slack. So, you will need the unique email address taken from slack, a record-triggered flow, an email template and an email alert. I completed a similar task recently that posted closed lost opportunity information to a specific Teams channel and have had no issues.

2
  • Thanks. How does one go about getting the channel's unique email address in Slack? Feb 18, 2023 at 21:52
  • I don't have Slack, but this is what I found online: "From your desktop, open the channel you'd like to send emails to. Click the details icon in the top right. Click More. Select Send emails to channel from the menu and click Get Channel Email Address. Slack will automatically generate an email address for the channel." Source: slack.com/help/articles/206819278-Send-emails-to-Slack
    – acastro
    Feb 20, 2023 at 15:37
0

I came up with a solution. What was happening is that Slack automatically adds the record from the URL. I created an AURA component that just takes a url Id parameter and redirects to that record. I added the AURA component to a community page. Then in the slack message I point it to the community page with the id of the record I want to end up at. Since the URL isn't a record it does not show up in slack, but when clicked on takes the user to the record.

cmp:

<aura:component implements="forceCommunity:availableForAllPageTypes,force:appHostable">
<aura:handler name="init" value="{!this}" action="{!c.doinit}" />
</aura:component>

({

contoller:

doinit: function (cmp, event, helper) {
    var Id;
    var query = decodeURIComponent(window.location.search.substring(1));
    var vars = query.split("&");
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] == "id" || pair[0] == "Id") {
            Id = pair[1];
            break;
        }
    }
    if (
        Id != null &&
        (
            Id.length == 15 ||
            Id.length == 18
        )
    ) {
        var newUrl = "https://.........lightning.force.com/" + Id;
        window.location.href = newUrl;
    }
}
})

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .