External Link to Upgrade a listing

This topic contains 9 replies, has 3 voices, and was last updated by  Alex Rollin 6 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #413315

    Jacob Paulsen
    Full Member
    Post count: 45

    I’m trying to setup some automated emails to business owners who list their own businesses in my directory.

    I would like to include in that email a link that can be clicked by the business owner and will take them to the upgrade page.

    From the page the link looks something like this:
    domain.com/add-listing/?pid=######&package_id=1

    In my email system I have the listing’s permalink but not the PID. So I have a link like this:
    domain.com/places/united-states/region/city/category/placename/

    This link doesn’t work:
    domain.com/places/united-states/region/city/category/placename/&package_id=1

    Is there a way to make this work?

    #413320

    Alex Rollin
    Moderator
    Post count: 27815

    Hello Jacob,

    are you using the listing owner’s WP account email (capture during registration?), or the email associated with the listing?

    #413322

    Jacob Paulsen
    Full Member
    Post count: 45

    The email associated with the listing.

    #413324

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    Thanks for writing back.

    The short answer is that the post_id is available in the listing export. If you export the listings, you will have both the post_id and the email in one place. You would also have the address and category information, and so could conceivably even rebuild the permalink from the listing export CSV.

    On the side of customization, I had several thoughts, but they are only ideas about how to proceed on your own or with a developer because it is outside what we can do here in support.

    First, if you don’t want to go through the process of regularly merging that post_id information into your external database, you should look at making sure that the post_id is captured into your system, as the permalink does not have some intrinsic relationship to the post_id.

    Second, if you wanted to use the listing owner’s wp account email, then you would need to look into running a SQL query or making an API connection.

    You make a good point that we will keep in mind as we consider future email features for future versions.

    Let me know if I missed something in your question, or if you want to ask it another way that might help us find a different solution.

    #413330

    Jacob Paulsen
    Full Member
    Post count: 45

    I think you misunderstood my question. I do not need help exporting the data. I’ve already built a custom plugin to push the data to my email solution. I understand that I could add to or tweak that customization to push the Post_id out to the email solution as well… but without doing that is there a way to provide a URL to the business owner via email that they can click that takes them directly to the upgrade page using the listing’s permalink?

    #413338

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    I’m sorry I wasn’t more clear. You have the correct link structure:

    domain.com/add-listing/?pid=######&package_id=1

    In fact, [#post_id#] is an optional replacement tag for GD notiications.

    For the second link, to make this work? I will consult with the team:

    domain.com/places/united-states/region/city/category/placename/&package_id=1

    Thanks

    #413345

    Jacob Paulsen
    Full Member
    Post count: 45

    Thanks Alex. Making that work as an alternative is what I’m going for.

    #413404

    Kiran
    Moderator
    Post count: 7069

    Hi Jacob,

    Use following code to get upgrade listing url by using listing ID & package ID.

    
    
    $post_ID = '47'; // REPLACE POST ID
    $package_ID = '5'; // REPLACE PACAKAGE ID
    $upgrade_url = geodir_getlink( get_permalink( geodir_add_listing_page_id() ), array( 'pid' => $post_ID, 'package_id' => $package_ID ), false );

    The variable $upgrade_url will retrieve upgrade url like https://MYSITE.com/add-listing/?pid=47&package_id=5

    Thanks,
    Kiran

    #413478

    Jacob Paulsen
    Full Member
    Post count: 45

    Sounds like there isn’t a way to achieve what I’m asking for. Thanks for the suggestions.

    #413527

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    It would be a customization, but you could install a redirection plugin, and load in the upgrade URLs as the destination for the link structure you mentioned.

Viewing 10 posts - 1 through 10 (of 10 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket