Enhancements to Referral Program, Dev.to Integration, and Terms Update

Overview

This update introduces an enhanced referral program with tiered commissions, seamless Dev.to integration, and updated terms and conditions to reflect these changes.

Referral Program Enhancements

The referral program has been expanded with the addition of a dedicated landing page, complete with details about the program, commission rates, and automated tools.

Key improvements include:

  • Landing Page: A new /earn landing page provides comprehensive information about the referral program.
  • Tiered Commissions: A tiered commission structure has been implemented, offering 40% for the first sale and 30% for renewals.
// Example demonstrating tiered commission calculation
func calculateCommission(isFirstSale bool, renewalCommissionValue float64, saleAmount float64) float64 {
	var commissionRate float64
	if isFirstSale {
		commissionRate = 0.40 // 40% for the first sale
	} else {
		commissionRate = renewalCommissionValue // Renewal commission rate
	}

	return commissionRate * saleAmount
}

Dev.to Integration

Full cross-posting integration with Dev.to has been added. This includes:

  • DevtoService: Handles communication with the Dev.to API.
  • Publishing coordinator: Manages the publishing workflow.
  • Scheduled job: Publishes posts with rate limiting to prevent API abuse.
  • Connect widget: Allows users to connect their Dev.to accounts.
  • PostCalendar toggle: Enables or disables Dev.to posting for specific posts.
// Example of rate limiting in DevtoService
func (s *DevtoService) PublishPost(post Post) error {
	// Implement rate limiting logic here to avoid hitting Dev.to API limits
	// For example, use a token bucket or leaky bucket algorithm

	// Simulate publishing to Dev.to
	fmt.Printf("Publishing post '%s' to Dev.to\n", post.Title)
	return nil
}

Platform-Aware Scheduled Post Dispatch

The system now supports platform-aware scheduled post dispatch, allowing posts to be routed to Dev.to and LinkedIn based on configuration.

// Example of platform-aware post dispatch
func dispatchPost(post Post, platform string) error {
	switch platform {
	case "dev.to":
		// Call DevtoService to publish the post
		fmt.Println("Dispatching to Dev.to")
		return nil
	case "linkedin":
		// Call LinkedinService to publish the post
		fmt.Println("Dispatching to LinkedIn")
		return nil
	default:
		return fmt.Errorf("unsupported platform: %s", platform)
	}
}

Terms and Conditions Update

The terms and conditions have been updated to include details about the referral program (section 13) and third-party integrations (section 14).

Conclusion

These updates enhance the user experience by providing a more rewarding referral program and seamless integration with Dev.to. The platform-aware post dispatch and updated terms and conditions ensure clarity and compliance.

Gerardo Ruiz

Gerardo Ruiz

Author

Share: