• Ulysses Shaw
  • NEWBIE
  • -1 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Hi
I´m not sure how to explain my problem, but I´ll give it a go:
Today we have an open Experience Cloud Site for All our students, anyone can access it and search for information. They are not added as Users in our environment.

We still want that in a way, but we don´t want them to be able to copy/share the URL with people outside and we don´t want to add any Users.

So, my question is:
Does anybody know if you can add a login-page before or lock a part of the site or encrypt the URL so it can´t be copied or another solution that I cannot think of.
 
Kind Regards
karin
 
I am not able to set password of developer edition which i created on verying it says the link is already been used
Created a new Custom object ,now i want to create this Custom Object as Tab in the App ,but when i create a "Lightning App",can't see the Custom object in Navigation Items,I checked in profiles as well ,i had full access to the custom object as i am salesforce admin

User-added image
Your help is highly appreciated

Fiona
Hi everyone.  I hope you can help with an issue i'm having around sending emails from apex.

What's the setup?
I have a web-to-case form setup, which is working fine in all aspects. I have a trigger/class that will verify the information and send an email back if details could not be found/matched in salesforce.  Valid cases come through just fine, having the System user as the CreatedBy.  Invalid or unmatched details have a process in place where the case is deleted and an email sent out to the address provided on the form asking the person to call instead.  The sender of this email is set from the Oeg-Wide Email Address list.  Here's an extract of the code handling this:
EmailTemplate emailTemplate = [SELECT Id, Body, HtmlValue FROM EmailTemplate WHERE DeveloperName = 'Case_W2C_Details_Mismatch_Template'];
            System.debug('Email template ID = '+emailTemplate.Id);
            OrgWideEmailAddress owea = [SELECT Id, Address, DisplayName FROM OrgWideEmailAddress WHERE Address = 'No-Reply@company.co.uk'];
            System.debug('Email address Id for sender = '+owea.Id);
            Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
            if ( owea != null) {email.setOrgWideEmailAddressId(owea.Id);}
            email.setToAddresses(emailAddresses);
            email.setSaveAsActivity(false);
            email.setSubject('Online Enquiry');
            email.setHtmlBody(emailTemplate.HtmlValue);
            email.setTemplateId(emailTemplate.Id);

            if(EmailDeliverabilityEnabled){
                Messaging.SendEmailResult [] res = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
                System.debug('Send email result' + res);
            }
            else {
                System.debug('WebToCaseService_Error: Email Deliverability is not enabled');
            }

So what's the issue then?
Every part of the process is working fine except the latter, where details are unmatched.  No email is going out to the address provided and in the logs i get this error:

EXCEPTION_THROWN|[169]|System.EmailException: SendEmail failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_OR_READONLY, Not profiled to access this Org-wide Email Address: []

What have i already tried?
1. I went to the no-reply email address in the Org-Wide Email Adresses and edited it to "Allow All Profiles to Use this From Address"

User-added image
This does work, however it allows users to be able to select this email when sending emssages via salesforce - whcih we don't want. 

2. If i "Allow only selected profiles.." and include System Administrator the above error is still faced. 

3. If i "Allow only selected profiles.." and manually select all listed profiles - i still get the same error.

4. I then set up another default no-reply address as a "Special Purpose Org-Wide Email Address" and changing the code to use this instead.  This also worked but is an address inaccessible to selected profiles, so doesn't resolve the issue without creating another.

My Questions then
Why would System user not be allowed access to Org-Wide Emails?  Is there a way around this without setting up a second no-reply address specifically for this purpose?

Many thanks for reading through this.
Aamir
  • July 26, 2021
  • Like
  • 1