Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Send Sharable Link Code
Send Sharable Link Code
Hello,
I've been looking at the Code Library to try and implement the Get a Sharable Link to Record code.
https://github.com/nuBuilder/nuBuilder- ... _of_record
Anyone know how this works and can be implimented as a button on a record? I've tried pasting it into the custom form code but just not sure what else it needs to get it working.
The most recent version looks very different to the previous versions.
Thanks,
Paul
I've been looking at the Code Library to try and implement the Get a Sharable Link to Record code.
https://github.com/nuBuilder/nuBuilder- ... _of_record
Anyone know how this works and can be implimented as a button on a record? I've tried pasting it into the custom form code but just not sure what else it needs to get it working.
The most recent version looks very different to the previous versions.
Thanks,
Paul
-
- nuBuilder Team
- Posts: 4302
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Send Sharable Link Code
Paul, as it's a PHP code, you can create a procedure an run it with
Code: Select all
nuRunPHPHidden('your_procedure_code_here',0)
Re: Send Sharable Link Code
Thanks kev1n but not too sure on the requirements for it?
It's not clear what the two arguments are and what you need to do with them. Also does this result in a popup so you can set the recipient, message etc?
Code: Select all
// 1. Argument ($origin): Leaving it blank, nuGetHttpOrigin() will be used to retrieve the domain (HTTP_ORIGIN or HTTP_REFERER or REMOTE_ADDR)
// 2. Argument ($subFolder): Leave blank if index.php is in the root.
$recordURL = nuGetRecordURL('', '', 'nuuserhome');
$r = nuSendEmail('to@test.com', 'from@test.com', 'From Name', 'Body' . $recordURL, 'Subject', [], true, '', '');
Re: Send Sharable Link Code
Should have said I tried the code in a procedure as is but nothing happens.
My nuBuilder currently runs on http://localhost/nubuilder, so not in the root as such. I've tried putting both and in the second empty ' ' but doesn't seem to have any effect.
My nuBuilder currently runs on http://localhost/nubuilder, so not in the root as such. I've tried putting both
Code: Select all
nubuilder
Code: Select all
/nubuilder
-
- nuBuilder Team
- Posts: 4302
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Send Sharable Link Code
The procedure's PHP code should look like this:
E.g. with the procedure code sendlink
To run the procedure (e.g. add to a button's onlick event):
nuRunPHPHidden('sendlink',0);
You will need the latest nucommon.php since I just fixed a bug.
Code: Select all
$recordURL = nuGetRecordURL('', 'nubuilder', 'nuuserhome');
$r = nuSendEmail('to@test.com', 'from@test.com', 'From Name', 'Body' . $recordURL, 'Subject', [], true, '', '');
To run the procedure (e.g. add to a button's onlick event):
nuRunPHPHidden('sendlink',0);
Code: Select all
Re: Send Sharable Link Code
Thanks kev1n, I've updated the system but still no luck.
I've tried the code you posted but onclick does nothing.
Just to check that I've not misread/misunderstood but this code is meant to send an email with a link to a record from that record?
I've tried the code you posted but onclick does nothing.
Just to check that I've not misread/misunderstood but this code is meant to send an email with a link to a record from that record?
-
- nuBuilder Team
- Posts: 4302
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Send Sharable Link Code
Yes, exactly. I just tested the code and it works fine for me. I suppose you have entered the email config details under Setup -> Email Settings.pmjd wrote:Just to check that I've not misread/misunderstood but this code is meant to send an email with a link to a record from that record?
Can you show screenshots of your onclick event code + PHP procedure code? You can mask private data of course.
Re: Send Sharable Link Code
Have checked and a test email is sent from nuBuilder and received.
The procedure code is and the onclick code
The procedure code is and the onclick code
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4302
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Send Sharable Link Code
Sorry afraid not, I meant a test email sent from the nuBuilder email setup screen sends successfully but the sharable link doesn't work.