Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable coming soon after onboarding if the user didn't opt-in #21

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

wpalani
Copy link
Member

@wpalani wpalani commented Jan 10, 2024

After onboarding fires newfold/onboarding/completed, we'll check if the user has interacted/opted-in. If they didn't, we'll disable the coming soon and set a timestamp.

This PR also exposes the 'last changed timestamp' value in both the container's service provider and the JS API.

Example

Service Provider:

$coming_soon_service = container()->get( 'comingSoon' );
$coming_soon_service->get_last_changed_timestamp(); // returns Unix timestamp
// or 
$coming_soon_service->get_last_changed_timestamp( true ); // returns date formatted timestamp

JavaScript API:

await NewfoldRuntime.comingSoon.lastChanged(); 
// returns date formatted timestamp, false if empty or null on error

This PR addresses part of this internal ticket: https://jira.newfold.com/browse/PRESS2-1505

includes/Service.php Outdated Show resolved Hide resolved
@wpalani wpalani merged commit 3758f8e into main Jan 11, 2024
6 checks passed
@wpscholar wpscholar deleted the add/onboarding-hook branch January 17, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants